From f4860870dae309f5287a287de0aa3a1a1b1de36b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 27 Nov 2018 16:55:56 +0300 Subject: scope-based resolve path --- .../ra_analysis/src/completion/reference_completion.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'crates/ra_analysis/src/completion/reference_completion.rs') diff --git a/crates/ra_analysis/src/completion/reference_completion.rs b/crates/ra_analysis/src/completion/reference_completion.rs index 924d2440f..a0af59178 100644 --- a/crates/ra_analysis/src/completion/reference_completion.rs +++ b/crates/ra_analysis/src/completion/reference_completion.rs @@ -42,8 +42,7 @@ pub(super) fn completions( let module_scope = module.scope(db)?; acc.extend( module_scope - .items - .iter() + .entries() .filter(|(_name, res)| { // Don't expose this item match res.import { @@ -162,14 +161,11 @@ fn complete_path( Some(it) => it, }; let module_scope = target_module.scope(db)?; - let completions = module_scope - .items - .iter() - .map(|(name, _res)| CompletionItem { - label: name.to_string(), - lookup: None, - snippet: None, - }); + let completions = module_scope.entries().map(|(name, _res)| CompletionItem { + label: name.to_string(), + lookup: None, + snippet: None, + }); acc.extend(completions); Ok(()) } -- cgit v1.2.3