diff options
Diffstat (limited to 'crates/ra_ide/src/completion/complete_pattern.rs')
-rw-r--r-- | crates/ra_ide/src/completion/complete_pattern.rs | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/crates/ra_ide/src/completion/complete_pattern.rs b/crates/ra_ide/src/completion/complete_pattern.rs index cb84bb934..bc8fade6f 100644 --- a/crates/ra_ide/src/completion/complete_pattern.rs +++ b/crates/ra_ide/src/completion/complete_pattern.rs | |||
@@ -56,6 +56,20 @@ mod tests { | |||
56 | assert_debug_snapshot!(completions, @r###" | 56 | assert_debug_snapshot!(completions, @r###" |
57 | [ | 57 | [ |
58 | CompletionItem { | 58 | CompletionItem { |
59 | label: "Bar", | ||
60 | source_range: [246; 246), | ||
61 | delete: [246; 246), | ||
62 | insert: "Bar", | ||
63 | kind: Struct, | ||
64 | }, | ||
65 | CompletionItem { | ||
66 | label: "E", | ||
67 | source_range: [246; 246), | ||
68 | delete: [246; 246), | ||
69 | insert: "E", | ||
70 | kind: Enum, | ||
71 | }, | ||
72 | CompletionItem { | ||
59 | label: "E", | 73 | label: "E", |
60 | source_range: [246; 246), | 74 | source_range: [246; 246), |
61 | delete: [246; 246), | 75 | delete: [246; 246), |
@@ -70,6 +84,20 @@ mod tests { | |||
70 | kind: EnumVariant, | 84 | kind: EnumVariant, |
71 | }, | 85 | }, |
72 | CompletionItem { | 86 | CompletionItem { |
87 | label: "X", | ||
88 | source_range: [246; 246), | ||
89 | delete: [246; 246), | ||
90 | insert: "X", | ||
91 | kind: EnumVariant, | ||
92 | }, | ||
93 | CompletionItem { | ||
94 | label: "Z", | ||
95 | source_range: [246; 246), | ||
96 | delete: [246; 246), | ||
97 | insert: "Z", | ||
98 | kind: Const, | ||
99 | }, | ||
100 | CompletionItem { | ||
73 | label: "Z", | 101 | label: "Z", |
74 | source_range: [246; 246), | 102 | source_range: [246; 246), |
75 | delete: [246; 246), | 103 | delete: [246; 246), |
@@ -83,6 +111,13 @@ mod tests { | |||
83 | insert: "m", | 111 | insert: "m", |
84 | kind: Module, | 112 | kind: Module, |
85 | }, | 113 | }, |
114 | CompletionItem { | ||
115 | label: "m", | ||
116 | source_range: [246; 246), | ||
117 | delete: [246; 246), | ||
118 | insert: "m", | ||
119 | kind: Module, | ||
120 | }, | ||
86 | ] | 121 | ] |
87 | "###); | 122 | "###); |
88 | } | 123 | } |
@@ -110,6 +145,21 @@ mod tests { | |||
110 | insert: "E", | 145 | insert: "E", |
111 | kind: Enum, | 146 | kind: Enum, |
112 | }, | 147 | }, |
148 | CompletionItem { | ||
149 | label: "E", | ||
150 | source_range: [151; 151), | ||
151 | delete: [151; 151), | ||
152 | insert: "E", | ||
153 | kind: Enum, | ||
154 | }, | ||
155 | CompletionItem { | ||
156 | label: "m!", | ||
157 | source_range: [151; 151), | ||
158 | delete: [151; 151), | ||
159 | insert: "m!($0)", | ||
160 | kind: Macro, | ||
161 | detail: "macro_rules! m", | ||
162 | }, | ||
113 | ] | 163 | ] |
114 | "###); | 164 | "###); |
115 | } | 165 | } |