mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-14 14:13:58 +00:00
Add ::
to label for crate::
completion
This commit is contained in:
parent
b081018363
commit
491d000c27
1 changed files with 7 additions and 7 deletions
|
@ -11,14 +11,14 @@ pub(super) fn complete_use_tree_keyword(acc: &mut Completions, ctx: &CompletionC
|
||||||
let source_range = ctx.source_range();
|
let source_range = ctx.source_range();
|
||||||
match (ctx.use_item_syntax.as_ref(), ctx.path_prefix.as_ref()) {
|
match (ctx.use_item_syntax.as_ref(), ctx.path_prefix.as_ref()) {
|
||||||
(Some(_), None) => {
|
(Some(_), None) => {
|
||||||
CompletionItem::new(CompletionKind::Keyword, source_range, "crate")
|
CompletionItem::new(CompletionKind::Keyword, source_range, "crate::")
|
||||||
.kind(CompletionItemKind::Keyword)
|
.kind(CompletionItemKind::Keyword)
|
||||||
.insert_text("crate::")
|
.insert_text("crate::")
|
||||||
.add_to(acc);
|
.add_to(acc);
|
||||||
CompletionItem::new(CompletionKind::Keyword, source_range, "self")
|
CompletionItem::new(CompletionKind::Keyword, source_range, "self")
|
||||||
.kind(CompletionItemKind::Keyword)
|
.kind(CompletionItemKind::Keyword)
|
||||||
.add_to(acc);
|
.add_to(acc);
|
||||||
CompletionItem::new(CompletionKind::Keyword, source_range, "super")
|
CompletionItem::new(CompletionKind::Keyword, source_range, "super::")
|
||||||
.kind(CompletionItemKind::Keyword)
|
.kind(CompletionItemKind::Keyword)
|
||||||
.insert_text("super::")
|
.insert_text("super::")
|
||||||
.add_to(acc);
|
.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")
|
CompletionItem::new(CompletionKind::Keyword, source_range, "self")
|
||||||
.kind(CompletionItemKind::Keyword)
|
.kind(CompletionItemKind::Keyword)
|
||||||
.add_to(acc);
|
.add_to(acc);
|
||||||
CompletionItem::new(CompletionKind::Keyword, source_range, "super")
|
CompletionItem::new(CompletionKind::Keyword, source_range, "super::")
|
||||||
.kind(CompletionItemKind::Keyword)
|
.kind(CompletionItemKind::Keyword)
|
||||||
.insert_text("super::")
|
.insert_text("super::")
|
||||||
.add_to(acc);
|
.add_to(acc);
|
||||||
|
@ -182,9 +182,9 @@ mod tests {
|
||||||
assert_snapshot!(
|
assert_snapshot!(
|
||||||
get_keyword_completions(r"use <|>"),
|
get_keyword_completions(r"use <|>"),
|
||||||
@r###"
|
@r###"
|
||||||
kw crate
|
kw crate::
|
||||||
kw self
|
kw self
|
||||||
kw super
|
kw super::
|
||||||
"###
|
"###
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ mod tests {
|
||||||
get_keyword_completions(r"use a::<|>"),
|
get_keyword_completions(r"use a::<|>"),
|
||||||
@r###"
|
@r###"
|
||||||
kw self
|
kw self
|
||||||
kw super
|
kw super::
|
||||||
"###
|
"###
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ mod tests {
|
||||||
get_keyword_completions(r"use a::{b, <|>}"),
|
get_keyword_completions(r"use a::{b, <|>}"),
|
||||||
@r###"
|
@r###"
|
||||||
kw self
|
kw self
|
||||||
kw super
|
kw super::
|
||||||
"###
|
"###
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue