diff options
Diffstat (limited to 'crates/ra_analysis/src/loc2id.rs')
-rw-r--r-- | crates/ra_analysis/src/loc2id.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/crates/ra_analysis/src/loc2id.rs b/crates/ra_analysis/src/loc2id.rs index 5b2c0f615..204708942 100644 --- a/crates/ra_analysis/src/loc2id.rs +++ b/crates/ra_analysis/src/loc2id.rs | |||
@@ -9,7 +9,6 @@ use rustc_hash::FxHashMap; | |||
9 | 9 | ||
10 | use crate::{ | 10 | use crate::{ |
11 | hir::{SourceItemId, ModuleId}, | 11 | hir::{SourceItemId, ModuleId}, |
12 | syntax_ptr::SyntaxPtr, | ||
13 | input::SourceRootId, | 12 | input::SourceRootId, |
14 | }; | 13 | }; |
15 | 14 | ||
@@ -112,10 +111,10 @@ pub(crate) struct IdMaps { | |||
112 | } | 111 | } |
113 | 112 | ||
114 | impl IdMaps { | 113 | impl IdMaps { |
115 | pub(crate) fn fn_id(&self, ptr: SyntaxPtr) -> FnId { | 114 | pub(crate) fn fn_id(&self, item_id: SourceItemId) -> FnId { |
116 | self.inner.fns.lock().loc2id(&ptr) | 115 | self.inner.fns.lock().loc2id(&item_id) |
117 | } | 116 | } |
118 | pub(crate) fn fn_ptr(&self, fn_id: FnId) -> SyntaxPtr { | 117 | pub(crate) fn fn_item_id(&self, fn_id: FnId) -> SourceItemId { |
119 | self.inner.fns.lock().id2loc(fn_id) | 118 | self.inner.fns.lock().id2loc(fn_id) |
120 | } | 119 | } |
121 | 120 | ||
@@ -129,6 +128,6 @@ impl IdMaps { | |||
129 | 128 | ||
130 | #[derive(Debug, Default)] | 129 | #[derive(Debug, Default)] |
131 | struct IdMapsInner { | 130 | struct IdMapsInner { |
132 | fns: Mutex<Loc2IdMap<SyntaxPtr, FnId>>, | 131 | fns: Mutex<Loc2IdMap<SourceItemId, FnId>>, |
133 | defs: Mutex<Loc2IdMap<DefLoc, DefId>>, | 132 | defs: Mutex<Loc2IdMap<DefLoc, DefId>>, |
134 | } | 133 | } |