diff options
Diffstat (limited to 'crates/ra_hir_def/src/lib.rs')
-rw-r--r-- | crates/ra_hir_def/src/lib.rs | 26 |
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 | ||
37 | use std::hash::{Hash, Hasher}; | 37 | use std::hash::{Hash, Hasher}; |
38 | 38 | ||
39 | use hir_expand::{ast_id_map::FileAstId, db::AstDatabase, AstId, HirFileId, MacroDefId, Source}; | 39 | use hir_expand::{ast_id_map::FileAstId, db::AstDatabase, AstId, HirFileId, InFile, MacroDefId}; |
40 | use ra_arena::{impl_arena_id, map::ArenaMap, RawId}; | 40 | use ra_arena::{impl_arena_id, map::ArenaMap, RawId}; |
41 | use ra_db::{impl_intern_key, salsa, CrateId}; | 41 | use ra_db::{impl_intern_key, salsa, CrateId}; |
42 | use ra_syntax::{ast, AstNode}; | 42 | use 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 | ||
518 | pub trait HasSource { | 518 | pub 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 | ||
523 | impl HasSource for FunctionLoc { | 523 | impl 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 | ||
532 | impl HasSource for TypeAliasLoc { | 532 | impl 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 | ||
541 | impl HasSource for ConstLoc { | 541 | impl 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 | ||
550 | impl HasSource for StaticLoc { | 550 | impl 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 | } |