From 4c90b7e2ecd03e739a3c92bbe5afd4c90fe2812d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 15 Nov 2019 23:24:56 +0300 Subject: Sourcify some things If we want to support macros properly, we need to get rid of those FileIds everywhere... --- crates/ra_hir/src/from_source.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'crates/ra_hir/src/from_source.rs') diff --git a/crates/ra_hir/src/from_source.rs b/crates/ra_hir/src/from_source.rs index ec56dfa6a..79152a57c 100644 --- a/crates/ra_hir/src/from_source.rs +++ b/crates/ra_hir/src/from_source.rs @@ -196,9 +196,8 @@ where N: AstNode, DEF: AstItemDef, { - let module_src = - crate::ModuleSource::from_child_node(db, src.file_id.original_file(db), &src.ast.syntax()); - let module = Module::from_definition(db, Source { file_id: src.file_id, ast: module_src })?; + let module_src = ModuleSource::from_child_node(db, src.as_ref().map(|it| it.syntax())); + let module = Module::from_definition(db, Source::new(src.file_id, module_src))?; let ctx = LocationCtx::new(db, module.id, src.file_id); Some(DEF::from_ast(ctx, &src.ast)) } -- cgit v1.2.3