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 + 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'crates/ra_analysis/src') 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)] -- cgit v1.2.3