aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r--crates/ra_hir/src/from_source.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/crates/ra_hir/src/from_source.rs b/crates/ra_hir/src/from_source.rs
index a46bba4f2..18d87f6d7 100644
--- a/crates/ra_hir/src/from_source.rs
+++ b/crates/ra_hir/src/from_source.rs
@@ -235,11 +235,10 @@ impl Module {
235 let src_parent = InFile { file_id: src.file_id, value: parent_declaration }; 235 let src_parent = InFile { file_id: src.file_id, value: parent_declaration };
236 Module::from_declaration(db, src_parent) 236 Module::from_declaration(db, src_parent)
237 } 237 }
238 _ => { 238 None => {
239 let src_parent = InFile { 239 let source_file = db.parse(src.file_id.original_file(db)).tree();
240 file_id: src.file_id, 240 let src_parent =
241 value: ModuleSource::from_file_id(db, src.file_id.original_file(db)), 241 InFile { file_id: src.file_id, value: ModuleSource::SourceFile(source_file) };
242 };
243 Module::from_definition(db, src_parent) 242 Module::from_definition(db, src_parent)
244 } 243 }
245 }?; 244 }?;