diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-11-23 14:13:50 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-11-23 14:13:50 +0000 |
commit | 1aded342266f18b519666ac512e77b0c211fff5d (patch) | |
tree | 48d78ab757f8df969e334ad9b7f1336f7ecc5f89 /crates/ra_hir/src/code_model | |
parent | 87903420968a958e9f420788edb181ddca7b8b31 (diff) | |
parent | ffc2325d194d2523456484a7dec1f175c729c1b5 (diff) |
Merge #2375
2375: Privatise nameres r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
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 | ||