aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/code_model_impl
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/code_model_impl')
-rw-r--r--crates/ra_hir/src/code_model_impl/module.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_hir/src/code_model_impl/module.rs b/crates/ra_hir/src/code_model_impl/module.rs
index 480ec27bf..418d59c91 100644
--- a/crates/ra_hir/src/code_model_impl/module.rs
+++ b/crates/ra_hir/src/code_model_impl/module.rs
@@ -25,9 +25,10 @@ impl Module {
25 25
26 pub(crate) fn definition_source_impl(&self, db: &impl HirDatabase) -> (FileId, ModuleSource) { 26 pub(crate) fn definition_source_impl(&self, db: &impl HirDatabase) -> (FileId, ModuleSource) {
27 let module_tree = db.module_tree(self.krate); 27 let module_tree = db.module_tree(self.krate);
28 let source = self.module_id.source(&module_tree); 28 let file_id = self.module_id.file_id(&module_tree);
29 let module_source = ModuleSource::from_source_item_id(db, source); 29 let decl_id = self.module_id.decl_id(&module_tree);
30 let file_id = source.file_id.as_original_file(); 30 let module_source = ModuleSource::new(db, file_id, decl_id);
31 let file_id = file_id.as_original_file();
31 (file_id, module_source) 32 (file_id, module_source)
32 } 33 }
33 34
@@ -39,8 +40,7 @@ impl Module {
39 let link = self.module_id.parent_link(&module_tree)?; 40 let link = self.module_id.parent_link(&module_tree)?;
40 let file_id = link 41 let file_id = link
41 .owner(&module_tree) 42 .owner(&module_tree)
42 .source(&module_tree) 43 .file_id(&module_tree)
43 .file_id
44 .as_original_file(); 44 .as_original_file();
45 let src = link.source(&module_tree, db); 45 let src = link.source(&module_tree, db);
46 Some((file_id, src)) 46 Some((file_id, src))