From 5575588387bcd2e36b8b757e9caa144fc2935f15 Mon Sep 17 00:00:00 2001 From: memoryruins Date: Sun, 12 Jan 2020 17:49:56 -0500 Subject: Add macro_rules item snippet --- crates/ra_ide/src/completion/complete_snippet.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'crates/ra_ide/src') diff --git a/crates/ra_ide/src/completion/complete_snippet.rs b/crates/ra_ide/src/completion/complete_snippet.rs index 1f2988b36..731b4fd82 100644 --- a/crates/ra_ide/src/completion/complete_snippet.rs +++ b/crates/ra_ide/src/completion/complete_snippet.rs @@ -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), -- cgit v1.2.3