From 498e3a6846602b9f2cd40c093007071b4df35817 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 22 Dec 2018 02:24:59 +0300 Subject: binding icon --- crates/ra_analysis/src/completion/complete_scope.rs | 6 ++++-- crates/ra_analysis/src/completion/completion_item.rs | 1 + 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; use crate::{ Cancelable, - completion::{CompletionItem, Completions, CompletionKind, CompletionContext}, + completion::{CompletionItem, CompletionItemKind, Completions, CompletionKind, CompletionContext}, }; 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) .flat_map(|scope| scopes.entries(scope).iter()) .filter(|entry| shadowed.insert(entry.name())) .for_each(|entry| { - CompletionItem::new(CompletionKind::Reference, entry.name().to_string()).add_to(acc) + CompletionItem::new(CompletionKind::Reference, entry.name().to_string()) + .kind(CompletionItemKind::Binding) + .add_to(acc) }); if scopes.self_param.is_some() { 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 { Keyword, Module, Function, + Binding, } #[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 { CompletionItemKind::Snippet => Snippet, CompletionItemKind::Module => Module, CompletionItemKind::Function => Function, + CompletionItemKind::Binding => Variable, } } } -- cgit v1.2.3