diff options
Diffstat (limited to 'crates/ra_analysis/src/completion/complete_scope.rs')
-rw-r--r-- | crates/ra_analysis/src/completion/complete_scope.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/crates/ra_analysis/src/completion/complete_scope.rs b/crates/ra_analysis/src/completion/complete_scope.rs index f39b98d62..fb87be4b1 100644 --- a/crates/ra_analysis/src/completion/complete_scope.rs +++ b/crates/ra_analysis/src/completion/complete_scope.rs | |||
@@ -3,7 +3,7 @@ use ra_syntax::TextUnit; | |||
3 | 3 | ||
4 | use crate::{ | 4 | use crate::{ |
5 | Cancelable, | 5 | Cancelable, |
6 | completion::{CompletionItem, Completions, CompletionKind::*, CompletionContext}, | 6 | completion::{CompletionItem, Completions, CompletionKind, CompletionContext}, |
7 | }; | 7 | }; |
8 | 8 | ||
9 | pub(super) fn complete_scope(acc: &mut Completions, ctx: &CompletionContext) -> Cancelable<()> { | 9 | pub(super) fn complete_scope(acc: &mut Completions, ctx: &CompletionContext) -> Cancelable<()> { |
@@ -29,7 +29,9 @@ pub(super) fn complete_scope(acc: &mut Completions, ctx: &CompletionContext) -> | |||
29 | } | 29 | } |
30 | } | 30 | } |
31 | }) | 31 | }) |
32 | .for_each(|(name, _res)| CompletionItem::new(Reference, name.to_string()).add_to(acc)); | 32 | .for_each(|(name, _res)| { |
33 | CompletionItem::new(CompletionKind::Reference, name.to_string()).add_to(acc) | ||
34 | }); | ||
33 | } | 35 | } |
34 | 36 | ||
35 | Ok(()) | 37 | Ok(()) |
@@ -41,9 +43,11 @@ fn complete_fn(acc: &mut Completions, scopes: &hir::FnScopes, offset: TextUnit) | |||
41 | .scope_chain_for_offset(offset) | 43 | .scope_chain_for_offset(offset) |
42 | .flat_map(|scope| scopes.entries(scope).iter()) | 44 | .flat_map(|scope| scopes.entries(scope).iter()) |
43 | .filter(|entry| shadowed.insert(entry.name())) | 45 | .filter(|entry| shadowed.insert(entry.name())) |
44 | .for_each(|entry| CompletionItem::new(Reference, entry.name().to_string()).add_to(acc)); | 46 | .for_each(|entry| { |
47 | CompletionItem::new(CompletionKind::Reference, entry.name().to_string()).add_to(acc) | ||
48 | }); | ||
45 | if scopes.self_param.is_some() { | 49 | if scopes.self_param.is_some() { |
46 | CompletionItem::new(Reference, "self").add_to(acc); | 50 | CompletionItem::new(CompletionKind::Reference, "self").add_to(acc); |
47 | } | 51 | } |
48 | } | 52 | } |
49 | 53 | ||