From 491d000c27676305cc7d5d734d4476cf731b7940 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 27 Jun 2020 12:25:08 +0200 Subject: Add `::` to label for `crate::` completion --- crates/ra_ide/src/completion/complete_keyword.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'crates') diff --git a/crates/ra_ide/src/completion/complete_keyword.rs b/crates/ra_ide/src/completion/complete_keyword.rs index b2f621a11..3b174f916 100644 --- a/crates/ra_ide/src/completion/complete_keyword.rs +++ b/crates/ra_ide/src/completion/complete_keyword.rs @@ -11,14 +11,14 @@ pub(super) fn complete_use_tree_keyword(acc: &mut Completions, ctx: &CompletionC let source_range = ctx.source_range(); match (ctx.use_item_syntax.as_ref(), ctx.path_prefix.as_ref()) { (Some(_), None) => { - CompletionItem::new(CompletionKind::Keyword, source_range, "crate") + CompletionItem::new(CompletionKind::Keyword, source_range, "crate::") .kind(CompletionItemKind::Keyword) .insert_text("crate::") .add_to(acc); CompletionItem::new(CompletionKind::Keyword, source_range, "self") .kind(CompletionItemKind::Keyword) .add_to(acc); - CompletionItem::new(CompletionKind::Keyword, source_range, "super") + CompletionItem::new(CompletionKind::Keyword, source_range, "super::") .kind(CompletionItemKind::Keyword) .insert_text("super::") .add_to(acc); @@ -27,7 +27,7 @@ pub(super) fn complete_use_tree_keyword(acc: &mut Completions, ctx: &CompletionC CompletionItem::new(CompletionKind::Keyword, source_range, "self") .kind(CompletionItemKind::Keyword) .add_to(acc); - CompletionItem::new(CompletionKind::Keyword, source_range, "super") + CompletionItem::new(CompletionKind::Keyword, source_range, "super::") .kind(CompletionItemKind::Keyword) .insert_text("super::") .add_to(acc); @@ -182,9 +182,9 @@ mod tests { assert_snapshot!( get_keyword_completions(r"use <|>"), @r###" - kw crate + kw crate:: kw self - kw super + kw super:: "### ); @@ -192,7 +192,7 @@ mod tests { get_keyword_completions(r"use a::<|>"), @r###" kw self - kw super + kw super:: "### ); @@ -200,7 +200,7 @@ mod tests { get_keyword_completions(r"use a::{b, <|>}"), @r###" kw self - kw super + kw super:: "### ); } -- cgit v1.2.3