diff options
Diffstat (limited to 'crates/ra_analysis/src/hir/function/mod.rs')
-rw-r--r-- | crates/ra_analysis/src/hir/function/mod.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/crates/ra_analysis/src/hir/function/mod.rs b/crates/ra_analysis/src/hir/function/mod.rs index 9ca8f4e7c..280218fd4 100644 --- a/crates/ra_analysis/src/hir/function/mod.rs +++ b/crates/ra_analysis/src/hir/function/mod.rs | |||
@@ -11,8 +11,8 @@ use ra_syntax::{ | |||
11 | }; | 11 | }; |
12 | 12 | ||
13 | use crate::{ | 13 | use crate::{ |
14 | hir::HirDatabase, | 14 | hir::{HirDatabase, SourceItemId}, |
15 | syntax_ptr::SyntaxPtr, FileId, | 15 | FileId, |
16 | }; | 16 | }; |
17 | 17 | ||
18 | pub(crate) use self::scope::FnScopes; | 18 | pub(crate) use self::scope::FnScopes; |
@@ -20,8 +20,10 @@ pub(crate) use crate::loc2id::FnId; | |||
20 | 20 | ||
21 | impl FnId { | 21 | impl FnId { |
22 | pub(crate) fn get(db: &impl HirDatabase, file_id: FileId, fn_def: ast::FnDef) -> FnId { | 22 | pub(crate) fn get(db: &impl HirDatabase, file_id: FileId, fn_def: ast::FnDef) -> FnId { |
23 | let ptr = SyntaxPtr::new(file_id, fn_def.syntax()); | 23 | let file_items = db.file_items(file_id); |
24 | db.id_maps().fn_id(ptr) | 24 | let item_id = file_items.id_of(fn_def.syntax()); |
25 | let item_id = SourceItemId { file_id, item_id }; | ||
26 | db.id_maps().fn_id(item_id) | ||
25 | } | 27 | } |
26 | } | 28 | } |
27 | 29 | ||