Merge #2816
2816: Add macro_rules item snippet r=matklad a=memoryruins
An user trying out rust-analyzer mentioned to me that they missed `rls-vscode`'s [macro_rules snippet](c2293a63d4/snippets/rust.json (L60)
)
![2020-01-12_17-47-34](https://user-images.githubusercontent.com/6868531/72227227-fcf46480-3567-11ea-9e3b-2f7319d127f7.gif)
Co-authored-by: memoryruins <memoryruinsmusic@gmail.com>
This commit is contained in:
commit
de717a8635
@ -36,6 +36,7 @@ fn ${1:feature}() {
|
||||
.lookup_by("tfn")
|
||||
.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);
|
||||
}
|
||||
|
||||
@ -106,6 +107,13 @@ mod tests {
|
||||
kind: Snippet,
|
||||
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 {
|
||||
label: "pub(crate)",
|
||||
source_range: [78; 78),
|
||||
|
Loading…
x
Reference in New Issue
Block a user