diff options
Diffstat (limited to 'crates/ra_hir/src/source_binder.rs')
-rw-r--r-- | crates/ra_hir/src/source_binder.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs index d1bf163d1..ea8185853 100644 --- a/crates/ra_hir/src/source_binder.rs +++ b/crates/ra_hir/src/source_binder.rs | |||
@@ -15,6 +15,7 @@ use ra_syntax::{ | |||
15 | use crate::{ | 15 | use crate::{ |
16 | HirDatabase, Function, SourceItemId, ModuleDef, | 16 | HirDatabase, Function, SourceItemId, ModuleDef, |
17 | AsName, Module, | 17 | AsName, Module, |
18 | ids::LocationCtx, | ||
18 | }; | 19 | }; |
19 | 20 | ||
20 | /// Locates the module by `FileId`. Picks topmost module in the file. | 21 | /// Locates the module by `FileId`. Picks topmost module in the file. |
@@ -116,7 +117,10 @@ pub fn function_from_module( | |||
116 | ) -> Function { | 117 | ) -> Function { |
117 | let (file_id, _) = module.definition_source(db); | 118 | let (file_id, _) = module.definition_source(db); |
118 | let file_id = file_id.into(); | 119 | let file_id = file_id.into(); |
119 | Function::from_ast(db, module, file_id, fn_def) | 120 | let ctx = LocationCtx::new(db, module, file_id); |
121 | Function { | ||
122 | id: ctx.to_def(fn_def), | ||
123 | } | ||
120 | } | 124 | } |
121 | 125 | ||
122 | pub fn function_from_child_node( | 126 | pub fn function_from_child_node( |