aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/ra_analysis/src/descriptors/module/nameres.rs26
1 files changed, 13 insertions, 13 deletions
diff --git a/crates/ra_analysis/src/descriptors/module/nameres.rs b/crates/ra_analysis/src/descriptors/module/nameres.rs
index a354fa54c..34127e78f 100644
--- a/crates/ra_analysis/src/descriptors/module/nameres.rs
+++ b/crates/ra_analysis/src/descriptors/module/nameres.rs
@@ -22,6 +22,19 @@ use crate::{
22 input::SourceRootId, 22 input::SourceRootId,
23}; 23};
24 24
25/// Item map is the result of the name resolution. Item map contains, for each
26/// module, the set of visible items.
27#[derive(Default, Debug, PartialEq, Eq)]
28pub(crate) struct ItemMap {
29 per_module: FxHashMap<ModuleId, ModuleItems>,
30}
31
32#[derive(Debug, Default, PartialEq, Eq)]
33struct ModuleItems {
34 items: FxHashMap<SmolStr, Resolution>,
35 import_resolutions: FxHashMap<LocalSyntaxPtr, DefId>,
36}
37
25/// A set of items and imports declared inside a module, without relation to 38/// A set of items and imports declared inside a module, without relation to
26/// other modules. 39/// other modules.
27/// 40///
@@ -101,19 +114,6 @@ pub(crate) fn item_map(
101 Ok(Arc::new(res)) 114 Ok(Arc::new(res))
102} 115}
103 116
104/// Item map is the result of the name resolution. Item map contains, for each
105/// module, the set of visible items.
106#[derive(Default, Debug, PartialEq, Eq)]
107pub(crate) struct ItemMap {
108 per_module: FxHashMap<ModuleId, ModuleItems>,
109}
110
111#[derive(Debug, Default, PartialEq, Eq)]
112struct ModuleItems {
113 items: FxHashMap<SmolStr, Resolution>,
114 import_resolutions: FxHashMap<LocalSyntaxPtr, DefId>,
115}
116
117/// Resolution is basically `DefId` atm, but it should account for stuff like 117/// Resolution is basically `DefId` atm, but it should account for stuff like
118/// multiple namespaces, ambiguity and errors. 118/// multiple namespaces, ambiguity and errors.
119#[derive(Debug, Clone, PartialEq, Eq)] 119#[derive(Debug, Clone, PartialEq, Eq)]