diff options
Diffstat (limited to 'crates/ra_hir/src/nameres.rs')
-rw-r--r-- | crates/ra_hir/src/nameres.rs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/crates/ra_hir/src/nameres.rs b/crates/ra_hir/src/nameres.rs index c34aa4b50..93c11f271 100644 --- a/crates/ra_hir/src/nameres.rs +++ b/crates/ra_hir/src/nameres.rs | |||
@@ -63,7 +63,7 @@ use test_utils::tested_by; | |||
63 | use crate::{ | 63 | use crate::{ |
64 | ModuleDef, Name, Crate, Module, | 64 | ModuleDef, Name, Crate, Module, |
65 | DefDatabase, Path, PathKind, HirFileId, Trait, | 65 | DefDatabase, Path, PathKind, HirFileId, Trait, |
66 | ids::{SourceItemId, SourceFileItemId, MacroCallId}, | 66 | ids::{SourceItemId, SourceFileItemId, MacroCallId, MacroDefId}, |
67 | diagnostics::DiagnosticSink, | 67 | diagnostics::DiagnosticSink, |
68 | nameres::diagnostics::DefDiagnostic, | 68 | nameres::diagnostics::DefDiagnostic, |
69 | }; | 69 | }; |
@@ -85,7 +85,7 @@ pub struct CrateDefMap { | |||
85 | root: CrateModuleId, | 85 | root: CrateModuleId, |
86 | modules: Arena<CrateModuleId, ModuleData>, | 86 | modules: Arena<CrateModuleId, ModuleData>, |
87 | macros: Arena<CrateMacroId, mbe::MacroRules>, | 87 | macros: Arena<CrateMacroId, mbe::MacroRules>, |
88 | public_macros: FxHashMap<Name, CrateMacroId>, | 88 | public_macros: FxHashMap<Name, MacroDefId>, |
89 | macro_resolutions: FxHashMap<MacroCallId, (Crate, CrateMacroId)>, | 89 | macro_resolutions: FxHashMap<MacroCallId, (Crate, CrateMacroId)>, |
90 | diagnostics: Vec<DefDiagnostic>, | 90 | diagnostics: Vec<DefDiagnostic>, |
91 | } | 91 | } |
@@ -238,13 +238,6 @@ impl CrateDefMap { | |||
238 | self.diagnostics.iter().for_each(|it| it.add_to(db, module, sink)) | 238 | self.diagnostics.iter().for_each(|it| it.add_to(db, module, sink)) |
239 | } | 239 | } |
240 | 240 | ||
241 | pub(crate) fn resolve_macro( | ||
242 | &self, | ||
243 | macro_call_id: MacroCallId, | ||
244 | ) -> Option<(Crate, CrateMacroId)> { | ||
245 | self.macro_resolutions.get(¯o_call_id).map(|&it| it) | ||
246 | } | ||
247 | |||
248 | pub(crate) fn find_module_by_source( | 241 | pub(crate) fn find_module_by_source( |
249 | &self, | 242 | &self, |
250 | file_id: HirFileId, | 243 | file_id: HirFileId, |