Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 5575588

Browse files
committed
Add macro_rules item snippet
1 parent a05970d commit 5575588

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

crates/ra_ide/src/completion/complete_snippet.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ fn ${1:feature}() {
3636
.lookup_by("tfn")
3737
.add_to(acc);
3838

39+
snippet(ctx, "macro_rules", "macro_rules! $1 {\n\t($2) => {\n\t\t$0\n\t};\n}").add_to(acc);
3940
snippet(ctx, "pub(crate)", "pub(crate) $0").add_to(acc);
4041
}
4142

@@ -106,6 +107,13 @@ mod tests {
106107
kind: Snippet,
107108
lookup: "tfn",
108109
},
110+
CompletionItem {
111+
label: "macro_rules",
112+
source_range: [78; 78),
113+
delete: [78; 78),
114+
insert: "macro_rules! $1 {\n\t($2) => {\n\t\t$0\n\t};\n}",
115+
kind: Snippet,
116+
},
109117
CompletionItem {
110118
label: "pub(crate)",
111119
source_range: [78; 78),

0 commit comments

Comments
 (0)