diff options
author | Aleksey Kladov <[email protected]> | 2018-11-27 13:55:56 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-11-27 15:25:35 +0000 |
commit | f4860870dae309f5287a287de0aa3a1a1b1de36b (patch) | |
tree | b487b5623db2a45f3c6cd3ae52e60b5fc90033a6 /crates/ra_analysis/src/completion/reference_completion.rs | |
parent | 68f66e0f446a2bd2385cfd236856f2a73bd58a3d (diff) |
scope-based resolve path
Diffstat (limited to 'crates/ra_analysis/src/completion/reference_completion.rs')
-rw-r--r-- | crates/ra_analysis/src/completion/reference_completion.rs | 16 |
1 files changed, 6 insertions, 10 deletions
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( | |||
42 | let module_scope = module.scope(db)?; | 42 | let module_scope = module.scope(db)?; |
43 | acc.extend( | 43 | acc.extend( |
44 | module_scope | 44 | module_scope |
45 | .items | 45 | .entries() |
46 | .iter() | ||
47 | .filter(|(_name, res)| { | 46 | .filter(|(_name, res)| { |
48 | // Don't expose this item | 47 | // Don't expose this item |
49 | match res.import { | 48 | match res.import { |
@@ -162,14 +161,11 @@ fn complete_path( | |||
162 | Some(it) => it, | 161 | Some(it) => it, |
163 | }; | 162 | }; |
164 | let module_scope = target_module.scope(db)?; | 163 | let module_scope = target_module.scope(db)?; |
165 | let completions = module_scope | 164 | let completions = module_scope.entries().map(|(name, _res)| CompletionItem { |
166 | .items | 165 | label: name.to_string(), |
167 | .iter() | 166 | lookup: None, |
168 | .map(|(name, _res)| CompletionItem { | 167 | snippet: None, |
169 | label: name.to_string(), | 168 | }); |
170 | lookup: None, | ||
171 | snippet: None, | ||
172 | }); | ||
173 | acc.extend(completions); | 169 | acc.extend(completions); |
174 | Ok(()) | 170 | Ok(()) |
175 | } | 171 | } |