From 25dda42f3773b1d002a5809c0182c2adc6c47027 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 22 Dec 2018 01:27:07 +0300 Subject: introduce ComletionItemKind --- crates/ra_analysis/src/completion/complete_snippet.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'crates/ra_analysis/src/completion/complete_snippet.rs') diff --git a/crates/ra_analysis/src/completion/complete_snippet.rs b/crates/ra_analysis/src/completion/complete_snippet.rs index ccd68832b..f0ad45fec 100644 --- a/crates/ra_analysis/src/completion/complete_snippet.rs +++ b/crates/ra_analysis/src/completion/complete_snippet.rs @@ -4,13 +4,11 @@ pub(super) fn complete_expr_snippet(acc: &mut Completions, ctx: &CompletionConte if !(ctx.is_trivial_path && ctx.enclosing_fn.is_some()) { return; } - CompletionItem::new("pd") + CompletionItem::new(Snippet, "pd") .snippet("eprintln!(\"$0 = {:?}\", $0);") - .kind(Snippet) .add_to(acc); - CompletionItem::new("ppd") + CompletionItem::new(Snippet, "ppd") .snippet("eprintln!(\"$0 = {:#?}\", $0);") - .kind(Snippet) .add_to(acc); } @@ -18,7 +16,7 @@ pub(super) fn complete_item_snippet(acc: &mut Completions, ctx: &CompletionConte if !ctx.is_new_item { return; } - CompletionItem::new("Test function") + CompletionItem::new(Snippet, "Test function") .lookup_by("tfn") .snippet( "\ @@ -27,11 +25,9 @@ fn ${1:feature}() { $0 }", ) - .kind(Snippet) .add_to(acc); - CompletionItem::new("pub(crate)") + CompletionItem::new(Snippet, "pub(crate)") .snippet("pub(crate) $0") - .kind(Snippet) .add_to(acc); } -- cgit v1.2.3