From ffc2325d194d2523456484a7dec1f175c729c1b5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 23 Nov 2019 17:06:04 +0300 Subject: Move ModuleSource back to hir --- crates/ra_hir/src/code_model/src.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crates/ra_hir/src/code_model') 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 { fn source(self, db: &impl DefDatabase) -> Source { let src = self.parent.definition_source(db); let (_, source_map) = db.raw_items_with_source_map(src.file_id); - src.with_value(source_map.get(&src.value, self.id)) + let root = db.parse_or_expand(src.file_id).unwrap(); + let ptr = source_map.get(self.id); + src.with_value(ptr.map(|it| it.to_node(&root), |it| it.to_node(&root))) } } -- cgit v1.2.3