mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
introduce ComletionItemKind
This commit is contained in:
parent
ebb584ce66
commit
25dda42f37
6 changed files with 28 additions and 34 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue