diff options
author | memoryruins <[email protected]> | 2020-01-12 22:49:56 +0000 |
---|---|---|
committer | memoryruins <[email protected]> | 2020-01-12 23:47:15 +0000 |
commit | 5575588387bcd2e36b8b757e9caa144fc2935f15 (patch) | |
tree | 91c2ccc743ee92cec55137c4d73333a914c46f7d /crates/ra_ide/src | |
parent | a05970da4671bd78457635deefa5ed8a2d24b00c (diff) |
Add macro_rules item snippet
Diffstat (limited to 'crates/ra_ide/src')
-rw-r--r-- | crates/ra_ide/src/completion/complete_snippet.rs | 8 |
1 files changed, 8 insertions, 0 deletions
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}() { | |||
36 | .lookup_by("tfn") | 36 | .lookup_by("tfn") |
37 | .add_to(acc); | 37 | .add_to(acc); |
38 | 38 | ||
39 | snippet(ctx, "macro_rules", "macro_rules! $1 {\n\t($2) => {\n\t\t$0\n\t};\n}").add_to(acc); | ||
39 | snippet(ctx, "pub(crate)", "pub(crate) $0").add_to(acc); | 40 | snippet(ctx, "pub(crate)", "pub(crate) $0").add_to(acc); |
40 | } | 41 | } |
41 | 42 | ||
@@ -107,6 +108,13 @@ mod tests { | |||
107 | lookup: "tfn", | 108 | lookup: "tfn", |
108 | }, | 109 | }, |
109 | CompletionItem { | 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 | }, | ||
117 | CompletionItem { | ||
110 | label: "pub(crate)", | 118 | label: "pub(crate)", |
111 | source_range: [78; 78), | 119 | source_range: [78; 78), |
112 | delete: [78; 78), | 120 | delete: [78; 78), |