diff options
Diffstat (limited to 'crates/ra_ide_api/src/completion/complete_scope.rs')
-rw-r--r-- | crates/ra_ide_api/src/completion/complete_scope.rs | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_scope.rs b/crates/ra_ide_api/src/completion/complete_scope.rs index bb080a341..958a12f22 100644 --- a/crates/ra_ide_api/src/completion/complete_scope.rs +++ b/crates/ra_ide_api/src/completion/complete_scope.rs | |||
@@ -29,9 +29,13 @@ pub(super) fn complete_scope(acc: &mut Completions, ctx: &CompletionContext) { | |||
29 | } | 29 | } |
30 | }) | 30 | }) |
31 | .for_each(|(name, res)| { | 31 | .for_each(|(name, res)| { |
32 | CompletionItem::new(CompletionKind::Reference, ctx, name.to_string()) | 32 | CompletionItem::new( |
33 | .from_resolution(ctx, res) | 33 | CompletionKind::Reference, |
34 | .add_to(acc) | 34 | ctx.leaf_range(), |
35 | name.to_string(), | ||
36 | ) | ||
37 | .from_resolution(ctx, res) | ||
38 | .add_to(acc) | ||
35 | }); | 39 | }); |
36 | } | 40 | } |
37 | 41 | ||
@@ -46,9 +50,13 @@ fn complete_fn( | |||
46 | .flat_map(|scope| scopes.scopes.entries(scope).iter()) | 50 | .flat_map(|scope| scopes.scopes.entries(scope).iter()) |
47 | .filter(|entry| shadowed.insert(entry.name())) | 51 | .filter(|entry| shadowed.insert(entry.name())) |
48 | .for_each(|entry| { | 52 | .for_each(|entry| { |
49 | CompletionItem::new(CompletionKind::Reference, ctx, entry.name().to_string()) | 53 | CompletionItem::new( |
50 | .kind(CompletionItemKind::Binding) | 54 | CompletionKind::Reference, |
51 | .add_to(acc) | 55 | ctx.leaf_range(), |
56 | entry.name().to_string(), | ||
57 | ) | ||
58 | .kind(CompletionItemKind::Binding) | ||
59 | .add_to(acc) | ||
52 | }); | 60 | }); |
53 | } | 61 | } |
54 | 62 | ||