diff options
author | Aleksey Kladov <[email protected]> | 2019-11-23 14:06:04 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-11-23 14:12:49 +0000 |
commit | ffc2325d194d2523456484a7dec1f175c729c1b5 (patch) | |
tree | 48d78ab757f8df969e334ad9b7f1336f7ecc5f89 /crates/ra_hir/src/code_model | |
parent | 6bdd5fa461ba0f3f3697339ffb560c577e3b0cc6 (diff) |
Move ModuleSource back to hir
Diffstat (limited to 'crates/ra_hir/src/code_model')
-rw-r--r-- | crates/ra_hir/src/code_model/src.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/ra_hir/src/code_model/src.rs b/crates/ra_hir/src/code_model/src.rs index 402f821bf..b7bafe23d 100644 --- a/crates/ra_hir/src/code_model/src.rs +++ b/crates/ra_hir/src/code_model/src.rs | |||
@@ -117,7 +117,9 @@ impl HasSource for Import { | |||
117 | fn source(self, db: &impl DefDatabase) -> Source<Self::Ast> { | 117 | fn source(self, db: &impl DefDatabase) -> Source<Self::Ast> { |
118 | let src = self.parent.definition_source(db); | 118 | let src = self.parent.definition_source(db); |
119 | let (_, source_map) = db.raw_items_with_source_map(src.file_id); | 119 | let (_, source_map) = db.raw_items_with_source_map(src.file_id); |
120 | src.with_value(source_map.get(&src.value, self.id)) | 120 | let root = db.parse_or_expand(src.file_id).unwrap(); |
121 | let ptr = source_map.get(self.id); | ||
122 | src.with_value(ptr.map(|it| it.to_node(&root), |it| it.to_node(&root))) | ||
121 | } | 123 | } |
122 | } | 124 | } |
123 | 125 | ||