diff options
Diffstat (limited to 'crates/ra_hir/src/code_model')
-rw-r--r-- | crates/ra_hir/src/code_model/src.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_hir/src/code_model/src.rs b/crates/ra_hir/src/code_model/src.rs index a4e317c20..bf3ee0834 100644 --- a/crates/ra_hir/src/code_model/src.rs +++ b/crates/ra_hir/src/code_model/src.rs | |||
@@ -22,7 +22,7 @@ impl Module { | |||
22 | /// Returns a node which defines this module. That is, a file or a `mod foo {}` with items. | 22 | /// Returns a node which defines this module. That is, a file or a `mod foo {}` with items. |
23 | pub fn definition_source(self, db: &impl DefDatabase) -> Source<ModuleSource> { | 23 | pub fn definition_source(self, db: &impl DefDatabase) -> Source<ModuleSource> { |
24 | let def_map = db.crate_def_map(self.id.krate); | 24 | let def_map = db.crate_def_map(self.id.krate); |
25 | let src = def_map[self.id.module_id].definition_source(db); | 25 | let src = def_map[self.id.local_id].definition_source(db); |
26 | src.map(|it| match it { | 26 | src.map(|it| match it { |
27 | Either::A(it) => ModuleSource::SourceFile(it), | 27 | Either::A(it) => ModuleSource::SourceFile(it), |
28 | Either::B(it) => ModuleSource::Module(it), | 28 | Either::B(it) => ModuleSource::Module(it), |
@@ -33,7 +33,7 @@ impl Module { | |||
33 | /// `None` for the crate root. | 33 | /// `None` for the crate root. |
34 | pub fn declaration_source(self, db: &impl DefDatabase) -> Option<Source<ast::Module>> { | 34 | pub fn declaration_source(self, db: &impl DefDatabase) -> Option<Source<ast::Module>> { |
35 | let def_map = db.crate_def_map(self.id.krate); | 35 | let def_map = db.crate_def_map(self.id.krate); |
36 | def_map[self.id.module_id].declaration_source(db) | 36 | def_map[self.id.local_id].declaration_source(db) |
37 | } | 37 | } |
38 | } | 38 | } |
39 | 39 | ||
@@ -51,13 +51,13 @@ impl HasSource for StructField { | |||
51 | impl HasSource for Struct { | 51 | impl HasSource for Struct { |
52 | type Ast = ast::StructDef; | 52 | type Ast = ast::StructDef; |
53 | fn source(self, db: &impl DefDatabase) -> Source<ast::StructDef> { | 53 | fn source(self, db: &impl DefDatabase) -> Source<ast::StructDef> { |
54 | self.id.0.source(db) | 54 | self.id.source(db) |
55 | } | 55 | } |
56 | } | 56 | } |
57 | impl HasSource for Union { | 57 | impl HasSource for Union { |
58 | type Ast = ast::StructDef; | 58 | type Ast = ast::UnionDef; |
59 | fn source(self, db: &impl DefDatabase) -> Source<ast::StructDef> { | 59 | fn source(self, db: &impl DefDatabase) -> Source<ast::UnionDef> { |
60 | self.id.0.source(db) | 60 | self.id.source(db) |
61 | } | 61 | } |
62 | } | 62 | } |
63 | impl HasSource for Enum { | 63 | impl HasSource for Enum { |