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 | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_scope.rs b/crates/ra_ide_api/src/completion/complete_scope.rs index eeaf26d93..6146b7bb6 100644 --- a/crates/ra_ide_api/src/completion/complete_scope.rs +++ b/crates/ra_ide_api/src/completion/complete_scope.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use crate::completion::{CompletionItem, Completions, CompletionKind, CompletionContext}; | 1 | use crate::completion::{Completions, CompletionContext}; |
2 | 2 | ||
3 | pub(super) fn complete_scope(acc: &mut Completions, ctx: &CompletionContext) { | 3 | pub(super) fn complete_scope(acc: &mut Completions, ctx: &CompletionContext) { |
4 | if !ctx.is_trivial_path { | 4 | if !ctx.is_trivial_path { |
@@ -6,17 +6,12 @@ pub(super) fn complete_scope(acc: &mut Completions, ctx: &CompletionContext) { | |||
6 | } | 6 | } |
7 | let names = ctx.resolver.all_names(ctx.db); | 7 | let names = ctx.resolver.all_names(ctx.db); |
8 | 8 | ||
9 | names.into_iter().for_each(|(name, res)| { | 9 | names.into_iter().for_each(|(name, res)| acc.add_resolution(ctx, name.to_string(), &res)); |
10 | CompletionItem::new(CompletionKind::Reference, ctx.source_range(), name.to_string()) | ||
11 | .from_resolution(ctx, &res) | ||
12 | .add_to(acc) | ||
13 | }); | ||
14 | } | 10 | } |
15 | 11 | ||
16 | #[cfg(test)] | 12 | #[cfg(test)] |
17 | mod tests { | 13 | mod tests { |
18 | use crate::completion::CompletionKind; | 14 | use crate::completion::{CompletionKind, check_completion}; |
19 | use crate::completion::completion_item::check_completion; | ||
20 | 15 | ||
21 | fn check_reference_completion(name: &str, code: &str) { | 16 | fn check_reference_completion(name: &str, code: &str) { |
22 | check_completion(name, code, CompletionKind::Reference); | 17 | check_completion(name, code, CompletionKind::Reference); |