aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/lib.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-11-28 09:50:26 +0000
committerAleksey Kladov <[email protected]>2019-11-28 09:50:26 +0000
commitccd1b0800a5de5e046e6e9a4b6f49030c1ce3639 (patch)
treee878f88aebf11c0e54eff2e107dfaa4d192ab272 /crates/ra_hir_def/src/lib.rs
parent2702fa1c5d6d8ad504c0d7703b6363ea09ba5570 (diff)
Rename Source -> InFile
Diffstat (limited to 'crates/ra_hir_def/src/lib.rs')
-rw-r--r--crates/ra_hir_def/src/lib.rs26
1 files changed, 13 insertions, 13 deletions
diff --git a/crates/ra_hir_def/src/lib.rs b/crates/ra_hir_def/src/lib.rs
index bc5530896..9d89692bf 100644
--- a/crates/ra_hir_def/src/lib.rs
+++ b/crates/ra_hir_def/src/lib.rs
@@ -36,7 +36,7 @@ mod marks;
36 36
37use std::hash::{Hash, Hasher}; 37use std::hash::{Hash, Hasher};
38 38
39use hir_expand::{ast_id_map::FileAstId, db::AstDatabase, AstId, HirFileId, MacroDefId, Source}; 39use hir_expand::{ast_id_map::FileAstId, db::AstDatabase, AstId, HirFileId, InFile, MacroDefId};
40use ra_arena::{impl_arena_id, map::ArenaMap, RawId}; 40use ra_arena::{impl_arena_id, map::ArenaMap, RawId};
41use ra_db::{impl_intern_key, salsa, CrateId}; 41use ra_db::{impl_intern_key, salsa, CrateId};
42use ra_syntax::{ast, AstNode}; 42use ra_syntax::{ast, AstNode};
@@ -105,10 +105,10 @@ pub trait AstItemDef<N: AstNode>: salsa::InternKey + Clone {
105 let loc = ItemLoc { module: ctx.module, ast_id: AstId::new(ctx.file_id, ast_id) }; 105 let loc = ItemLoc { module: ctx.module, ast_id: AstId::new(ctx.file_id, ast_id) };
106 Self::intern(ctx.db, loc) 106 Self::intern(ctx.db, loc)
107 } 107 }
108 fn source(self, db: &(impl AstDatabase + InternDatabase)) -> Source<N> { 108 fn source(self, db: &(impl AstDatabase + InternDatabase)) -> InFile<N> {
109 let loc = self.lookup_intern(db); 109 let loc = self.lookup_intern(db);
110 let value = loc.ast_id.to_node(db); 110 let value = loc.ast_id.to_node(db);
111 Source { file_id: loc.ast_id.file_id(), value } 111 InFile { file_id: loc.ast_id.file_id(), value }
112 } 112 }
113 fn module(self, db: &impl InternDatabase) -> ModuleId { 113 fn module(self, db: &impl InternDatabase) -> ModuleId {
114 let loc = self.lookup_intern(db); 114 let loc = self.lookup_intern(db);
@@ -517,42 +517,42 @@ impl HasModule for StaticLoc {
517 517
518pub trait HasSource { 518pub trait HasSource {
519 type Value; 519 type Value;
520 fn source(&self, db: &impl db::DefDatabase) -> Source<Self::Value>; 520 fn source(&self, db: &impl db::DefDatabase) -> InFile<Self::Value>;
521} 521}
522 522
523impl HasSource for FunctionLoc { 523impl HasSource for FunctionLoc {
524 type Value = ast::FnDef; 524 type Value = ast::FnDef;
525 525
526 fn source(&self, db: &impl db::DefDatabase) -> Source<ast::FnDef> { 526 fn source(&self, db: &impl db::DefDatabase) -> InFile<ast::FnDef> {
527 let node = self.ast_id.to_node(db); 527 let node = self.ast_id.to_node(db);
528 Source::new(self.ast_id.file_id(), node) 528 InFile::new(self.ast_id.file_id(), node)
529 } 529 }
530} 530}
531 531
532impl HasSource for TypeAliasLoc { 532impl HasSource for TypeAliasLoc {
533 type Value = ast::TypeAliasDef; 533 type Value = ast::TypeAliasDef;
534 534
535 fn source(&self, db: &impl db::DefDatabase) -> Source<ast::TypeAliasDef> { 535 fn source(&self, db: &impl db::DefDatabase) -> InFile<ast::TypeAliasDef> {
536 let node = self.ast_id.to_node(db); 536 let node = self.ast_id.to_node(db);
537 Source::new(self.ast_id.file_id(), node) 537 InFile::new(self.ast_id.file_id(), node)
538 } 538 }
539} 539}
540 540
541impl HasSource for ConstLoc { 541impl HasSource for ConstLoc {
542 type Value = ast::ConstDef; 542 type Value = ast::ConstDef;
543 543
544 fn source(&self, db: &impl db::DefDatabase) -> Source<ast::ConstDef> { 544 fn source(&self, db: &impl db::DefDatabase) -> InFile<ast::ConstDef> {
545 let node = self.ast_id.to_node(db); 545 let node = self.ast_id.to_node(db);
546 Source::new(self.ast_id.file_id(), node) 546 InFile::new(self.ast_id.file_id(), node)
547 } 547 }
548} 548}
549 549
550impl HasSource for StaticLoc { 550impl HasSource for StaticLoc {
551 type Value = ast::StaticDef; 551 type Value = ast::StaticDef;
552 552
553 fn source(&self, db: &impl db::DefDatabase) -> Source<ast::StaticDef> { 553 fn source(&self, db: &impl db::DefDatabase) -> InFile<ast::StaticDef> {
554 let node = self.ast_id.to_node(db); 554 let node = self.ast_id.to_node(db);
555 Source::new(self.ast_id.file_id(), node) 555 InFile::new(self.ast_id.file_id(), node)
556 } 556 }
557} 557}
558 558
@@ -562,5 +562,5 @@ pub trait HasChildSource {
562 fn child_source( 562 fn child_source(
563 &self, 563 &self,
564 db: &impl db::DefDatabase, 564 db: &impl db::DefDatabase,
565 ) -> Source<ArenaMap<Self::ChildId, Self::Value>>; 565 ) -> InFile<ArenaMap<Self::ChildId, Self::Value>>;
566} 566}