diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_analysis/src/completion/complete_scope.rs | 6 | ||||
-rw-r--r-- | crates/ra_analysis/src/completion/completion_item.rs | 1 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/conv.rs | 1 |
3 files changed, 6 insertions, 2 deletions
diff --git a/crates/ra_analysis/src/completion/complete_scope.rs b/crates/ra_analysis/src/completion/complete_scope.rs index 4f27ad9eb..82610d63f 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, CompletionItemKind, 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<()> { |
@@ -46,7 +46,9 @@ fn complete_fn(acc: &mut Completions, scopes: &hir::FnScopes, offset: TextUnit) | |||
46 | .flat_map(|scope| scopes.entries(scope).iter()) | 46 | .flat_map(|scope| scopes.entries(scope).iter()) |
47 | .filter(|entry| shadowed.insert(entry.name())) | 47 | .filter(|entry| shadowed.insert(entry.name())) |
48 | .for_each(|entry| { | 48 | .for_each(|entry| { |
49 | CompletionItem::new(CompletionKind::Reference, entry.name().to_string()).add_to(acc) | 49 | CompletionItem::new(CompletionKind::Reference, entry.name().to_string()) |
50 | .kind(CompletionItemKind::Binding) | ||
51 | .add_to(acc) | ||
50 | }); | 52 | }); |
51 | if scopes.self_param.is_some() { | 53 | if scopes.self_param.is_some() { |
52 | CompletionItem::new(CompletionKind::Reference, "self").add_to(acc); | 54 | CompletionItem::new(CompletionKind::Reference, "self").add_to(acc); |
diff --git a/crates/ra_analysis/src/completion/completion_item.rs b/crates/ra_analysis/src/completion/completion_item.rs index cbd42a44e..911f08468 100644 --- a/crates/ra_analysis/src/completion/completion_item.rs +++ b/crates/ra_analysis/src/completion/completion_item.rs | |||
@@ -25,6 +25,7 @@ pub enum CompletionItemKind { | |||
25 | Keyword, | 25 | Keyword, |
26 | Module, | 26 | Module, |
27 | Function, | 27 | Function, |
28 | Binding, | ||
28 | } | 29 | } |
29 | 30 | ||
30 | #[derive(Debug, PartialEq, Eq)] | 31 | #[derive(Debug, PartialEq, Eq)] |
diff --git a/crates/ra_lsp_server/src/conv.rs b/crates/ra_lsp_server/src/conv.rs index 9320f147a..051f1f995 100644 --- a/crates/ra_lsp_server/src/conv.rs +++ b/crates/ra_lsp_server/src/conv.rs | |||
@@ -55,6 +55,7 @@ impl Conv for CompletionItemKind { | |||
55 | CompletionItemKind::Snippet => Snippet, | 55 | CompletionItemKind::Snippet => Snippet, |
56 | CompletionItemKind::Module => Module, | 56 | CompletionItemKind::Module => Module, |
57 | CompletionItemKind::Function => Function, | 57 | CompletionItemKind::Function => Function, |
58 | CompletionItemKind::Binding => Variable, | ||
58 | } | 59 | } |
59 | } | 60 | } |
60 | } | 61 | } |