mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Add macro_rules item snippet
This commit is contained in:
parent
a05970da46
commit
5575588387
1 changed files with 8 additions and 0 deletions
|
@ -36,6 +36,7 @@ fn ${1:feature}() {
|
||||||
.lookup_by("tfn")
|
.lookup_by("tfn")
|
||||||
.add_to(acc);
|
.add_to(acc);
|
||||||
|
|
||||||
|
snippet(ctx, "macro_rules", "macro_rules! $1 {\n\t($2) => {\n\t\t$0\n\t};\n}").add_to(acc);
|
||||||
snippet(ctx, "pub(crate)", "pub(crate) $0").add_to(acc);
|
snippet(ctx, "pub(crate)", "pub(crate) $0").add_to(acc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,6 +107,13 @@ mod tests {
|
||||||
kind: Snippet,
|
kind: Snippet,
|
||||||
lookup: "tfn",
|
lookup: "tfn",
|
||||||
},
|
},
|
||||||
|
CompletionItem {
|
||||||
|
label: "macro_rules",
|
||||||
|
source_range: [78; 78),
|
||||||
|
delete: [78; 78),
|
||||||
|
insert: "macro_rules! $1 {\n\t($2) => {\n\t\t$0\n\t};\n}",
|
||||||
|
kind: Snippet,
|
||||||
|
},
|
||||||
CompletionItem {
|
CompletionItem {
|
||||||
label: "pub(crate)",
|
label: "pub(crate)",
|
||||||
source_range: [78; 78),
|
source_range: [78; 78),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue