aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/module/nameres.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-12-09 09:24:52 +0000
committerAleksey Kladov <[email protected]>2018-12-09 10:33:16 +0000
commit8b9ff46b378e37b256f6b93f1f6f3bb5bc122064 (patch)
tree214828c8e3aa2a397a56556af90775e4686cfb1e /crates/ra_hir/src/module/nameres.rs
parent74fe581061be5175835efda69ee1fa3817716a59 (diff)
make resolver fields private
Diffstat (limited to 'crates/ra_hir/src/module/nameres.rs')
-rw-r--r--crates/ra_hir/src/module/nameres.rs25
1 files changed, 20 insertions, 5 deletions
diff --git a/crates/ra_hir/src/module/nameres.rs b/crates/ra_hir/src/module/nameres.rs
index 6511359d0..c75c1bbea 100644
--- a/crates/ra_hir/src/module/nameres.rs
+++ b/crates/ra_hir/src/module/nameres.rs
@@ -200,17 +200,32 @@ impl ModuleItem {
200} 200}
201 201
202pub(crate) struct Resolver<'a, DB> { 202pub(crate) struct Resolver<'a, DB> {
203 pub(crate) db: &'a DB, 203 db: &'a DB,
204 pub(crate) input: &'a FxHashMap<ModuleId, Arc<InputModuleItems>>, 204 input: &'a FxHashMap<ModuleId, Arc<InputModuleItems>>,
205 pub(crate) source_root: SourceRootId, 205 source_root: SourceRootId,
206 pub(crate) module_tree: Arc<ModuleTree>, 206 module_tree: Arc<ModuleTree>,
207 pub(crate) result: ItemMap, 207 result: ItemMap,
208} 208}
209 209
210impl<'a, DB> Resolver<'a, DB> 210impl<'a, DB> Resolver<'a, DB>
211where 211where
212 DB: HirDatabase, 212 DB: HirDatabase,
213{ 213{
214 pub(crate) fn new(
215 db: &'a DB,
216 input: &'a FxHashMap<ModuleId, Arc<InputModuleItems>>,
217 source_root: SourceRootId,
218 module_tree: Arc<ModuleTree>,
219 ) -> Resolver<'a, DB> {
220 Resolver {
221 db: db,
222 input: &input,
223 source_root,
224 module_tree,
225 result: ItemMap::default(),
226 }
227 }
228
214 pub(crate) fn resolve(mut self) -> Cancelable<ItemMap> { 229 pub(crate) fn resolve(mut self) -> Cancelable<ItemMap> {
215 for (&module_id, items) in self.input.iter() { 230 for (&module_id, items) in self.input.iter() {
216 self.populate_module(module_id, items) 231 self.populate_module(module_id, items)