mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 23:25:03 +00:00
Add !
to the macro completion label
This commit is contained in:
parent
037e02c08d
commit
1852b27233
4 changed files with 25 additions and 21 deletions
|
@ -108,13 +108,17 @@ impl Completions {
|
|||
let ast_node = macro_.source(ctx.db).ast;
|
||||
if let Some(name) = name {
|
||||
let detail = macro_label(&ast_node);
|
||||
let code_declaration = name + "!";
|
||||
|
||||
let builder =
|
||||
CompletionItem::new(CompletionKind::Reference, ctx.source_range(), name.clone())
|
||||
.kind(CompletionItemKind::Macro)
|
||||
.set_documentation(macro_.docs(ctx.db))
|
||||
.detail(detail)
|
||||
.insert_snippet(format!("{}!($0)", name));
|
||||
let builder = CompletionItem::new(
|
||||
CompletionKind::Reference,
|
||||
ctx.source_range(),
|
||||
&code_declaration,
|
||||
)
|
||||
.kind(CompletionItemKind::Macro)
|
||||
.set_documentation(macro_.docs(ctx.db))
|
||||
.detail(detail)
|
||||
.insert_snippet(format!("{}($0)", &code_declaration));
|
||||
|
||||
self.add(builder);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue