diff options
Diffstat (limited to 'crates/ra_ide_api/src')
63 files changed, 748 insertions, 725 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_dot.rs b/crates/ra_ide_api/src/completion/complete_dot.rs index 2e8084699..5bf289c63 100644 --- a/crates/ra_ide_api/src/completion/complete_dot.rs +++ b/crates/ra_ide_api/src/completion/complete_dot.rs | |||
@@ -66,16 +66,18 @@ mod tests { | |||
66 | } | 66 | } |
67 | ", | 67 | ", |
68 | ), | 68 | ), |
69 | @r###"[ | 69 | @r###" |
70 | CompletionItem { | 70 | ⋮[ |
71 | label: "the_field", | 71 | ⋮ CompletionItem { |
72 | source_range: [94; 94), | 72 | ⋮ label: "the_field", |
73 | delete: [94; 94), | 73 | ⋮ source_range: [94; 94), |
74 | insert: "the_field", | 74 | ⋮ delete: [94; 94), |
75 | kind: Field, | 75 | ⋮ insert: "the_field", |
76 | detail: "u32" | 76 | ⋮ kind: Field, |
77 | } | 77 | ⋮ detail: "u32", |
78 | ]"### | 78 | ⋮ }, |
79 | ⋮] | ||
80 | "### | ||
79 | ); | 81 | ); |
80 | } | 82 | } |
81 | 83 | ||
@@ -95,27 +97,29 @@ mod tests { | |||
95 | } | 97 | } |
96 | ", | 98 | ", |
97 | ), | 99 | ), |
98 | @r###"[ | 100 | @r###" |
99 | CompletionItem { | 101 | ⋮[ |
100 | label: "foo", | 102 | ⋮ CompletionItem { |
101 | source_range: [187; 187), | 103 | ⋮ label: "foo", |
102 | delete: [187; 187), | 104 | ⋮ source_range: [187; 187), |
103 | insert: "foo()$0", | 105 | ⋮ delete: [187; 187), |
104 | kind: Method, | 106 | ⋮ insert: "foo()$0", |
105 | detail: "fn foo(self)" | 107 | ⋮ kind: Method, |
106 | }, | 108 | ⋮ detail: "fn foo(self)", |
107 | CompletionItem { | 109 | ⋮ }, |
108 | label: "the_field", | 110 | ⋮ CompletionItem { |
109 | source_range: [187; 187), | 111 | ⋮ label: "the_field", |
110 | delete: [187; 187), | 112 | ⋮ source_range: [187; 187), |
111 | insert: "the_field", | 113 | ⋮ delete: [187; 187), |
112 | kind: Field, | 114 | ⋮ insert: "the_field", |
113 | detail: "(u32,)", | 115 | ⋮ kind: Field, |
114 | documentation: Documentation( | 116 | ⋮ detail: "(u32,)", |
115 | "This is the_field" | 117 | ⋮ documentation: Documentation( |
116 | ) | 118 | ⋮ "This is the_field", |
117 | } | 119 | ⋮ ), |
118 | ]"### | 120 | ⋮ }, |
121 | ⋮] | ||
122 | "### | ||
119 | ); | 123 | ); |
120 | } | 124 | } |
121 | 125 | ||
@@ -132,24 +136,26 @@ mod tests { | |||
132 | } | 136 | } |
133 | ", | 137 | ", |
134 | ), | 138 | ), |
135 | @r###"[ | 139 | @r###" |
136 | CompletionItem { | 140 | ⋮[ |
137 | label: "foo", | 141 | ⋮ CompletionItem { |
138 | source_range: [126; 126), | 142 | ⋮ label: "foo", |
139 | delete: [126; 126), | 143 | ⋮ source_range: [126; 126), |
140 | insert: "foo()$0", | 144 | ⋮ delete: [126; 126), |
141 | kind: Method, | 145 | ⋮ insert: "foo()$0", |
142 | detail: "fn foo(&self)" | 146 | ⋮ kind: Method, |
143 | }, | 147 | ⋮ detail: "fn foo(&self)", |
144 | CompletionItem { | 148 | ⋮ }, |
145 | label: "the_field", | 149 | ⋮ CompletionItem { |
146 | source_range: [126; 126), | 150 | ⋮ label: "the_field", |
147 | delete: [126; 126), | 151 | ⋮ source_range: [126; 126), |
148 | insert: "the_field", | 152 | ⋮ delete: [126; 126), |
149 | kind: Field, | 153 | ⋮ insert: "the_field", |
150 | detail: "(u32, i32)" | 154 | ⋮ kind: Field, |
151 | } | 155 | ⋮ detail: "(u32, i32)", |
152 | ]"### | 156 | ⋮ }, |
157 | ⋮] | ||
158 | "### | ||
153 | ); | 159 | ); |
154 | } | 160 | } |
155 | 161 | ||
@@ -182,16 +188,18 @@ mod tests { | |||
182 | } | 188 | } |
183 | ", | 189 | ", |
184 | ), | 190 | ), |
185 | @r###"[ | 191 | @r###" |
186 | CompletionItem { | 192 | ⋮[ |
187 | label: "the_method", | 193 | ⋮ CompletionItem { |
188 | source_range: [144; 144), | 194 | ⋮ label: "the_method", |
189 | delete: [144; 144), | 195 | ⋮ source_range: [144; 144), |
190 | insert: "the_method()$0", | 196 | ⋮ delete: [144; 144), |
191 | kind: Method, | 197 | ⋮ insert: "the_method()$0", |
192 | detail: "fn the_method(&self)" | 198 | ⋮ kind: Method, |
193 | } | 199 | ⋮ detail: "fn the_method(&self)", |
194 | ]"### | 200 | ⋮ }, |
201 | ⋮] | ||
202 | "### | ||
195 | ); | 203 | ); |
196 | } | 204 | } |
197 | 205 | ||
@@ -208,16 +216,18 @@ mod tests { | |||
208 | } | 216 | } |
209 | ", | 217 | ", |
210 | ), | 218 | ), |
211 | @r###"[ | 219 | @r###" |
212 | CompletionItem { | 220 | ⋮[ |
213 | label: "the_method", | 221 | ⋮ CompletionItem { |
214 | source_range: [151; 151), | 222 | ⋮ label: "the_method", |
215 | delete: [151; 151), | 223 | ⋮ source_range: [151; 151), |
216 | insert: "the_method()$0", | 224 | ⋮ delete: [151; 151), |
217 | kind: Method, | 225 | ⋮ insert: "the_method()$0", |
218 | detail: "fn the_method(&self)" | 226 | ⋮ kind: Method, |
219 | } | 227 | ⋮ detail: "fn the_method(&self)", |
220 | ]"### | 228 | ⋮ }, |
229 | ⋮] | ||
230 | "### | ||
221 | ); | 231 | ); |
222 | } | 232 | } |
223 | 233 | ||
@@ -257,16 +267,18 @@ mod tests { | |||
257 | } | 267 | } |
258 | ", | 268 | ", |
259 | ), | 269 | ), |
260 | @r###"[ | 270 | @r###" |
261 | CompletionItem { | 271 | ⋮[ |
262 | label: "the_method", | 272 | ⋮ CompletionItem { |
263 | source_range: [249; 249), | 273 | ⋮ label: "the_method", |
264 | delete: [249; 249), | 274 | ⋮ source_range: [249; 249), |
265 | insert: "the_method()$0", | 275 | ⋮ delete: [249; 249), |
266 | kind: Method, | 276 | ⋮ insert: "the_method()$0", |
267 | detail: "fn the_method(&self)" | 277 | ⋮ kind: Method, |
268 | } | 278 | ⋮ detail: "fn the_method(&self)", |
269 | ]"### | 279 | ⋮ }, |
280 | ⋮] | ||
281 | "### | ||
270 | ); | 282 | ); |
271 | } | 283 | } |
272 | 284 | ||
@@ -281,24 +293,26 @@ mod tests { | |||
281 | } | 293 | } |
282 | ", | 294 | ", |
283 | ), | 295 | ), |
284 | @r###"[ | 296 | @r###" |
285 | CompletionItem { | 297 | ⋮[ |
286 | label: "0", | 298 | ⋮ CompletionItem { |
287 | source_range: [75; 75), | 299 | ⋮ label: "0", |
288 | delete: [75; 75), | 300 | ⋮ source_range: [75; 75), |
289 | insert: "0", | 301 | ⋮ delete: [75; 75), |
290 | kind: Field, | 302 | ⋮ insert: "0", |
291 | detail: "i32" | 303 | ⋮ kind: Field, |
292 | }, | 304 | ⋮ detail: "i32", |
293 | CompletionItem { | 305 | ⋮ }, |
294 | label: "1", | 306 | ⋮ CompletionItem { |
295 | source_range: [75; 75), | 307 | ⋮ label: "1", |
296 | delete: [75; 75), | 308 | ⋮ source_range: [75; 75), |
297 | insert: "1", | 309 | ⋮ delete: [75; 75), |
298 | kind: Field, | 310 | ⋮ insert: "1", |
299 | detail: "f64" | 311 | ⋮ kind: Field, |
300 | } | 312 | ⋮ detail: "f64", |
301 | ]"### | 313 | ⋮ }, |
314 | ⋮] | ||
315 | "### | ||
302 | ); | 316 | ); |
303 | } | 317 | } |
304 | 318 | ||
@@ -322,16 +336,18 @@ mod tests { | |||
322 | } | 336 | } |
323 | ", | 337 | ", |
324 | ), | 338 | ), |
325 | @r###"[ | 339 | @r###" |
326 | CompletionItem { | 340 | ⋮[ |
327 | label: "blah", | 341 | ⋮ CompletionItem { |
328 | source_range: [299; 300), | 342 | ⋮ label: "blah", |
329 | delete: [299; 300), | 343 | ⋮ source_range: [299; 300), |
330 | insert: "blah()$0", | 344 | ⋮ delete: [299; 300), |
331 | kind: Method, | 345 | ⋮ insert: "blah()$0", |
332 | detail: "pub fn blah(&self)" | 346 | ⋮ kind: Method, |
333 | } | 347 | ⋮ detail: "pub fn blah(&self)", |
334 | ]"### | 348 | ⋮ }, |
349 | ⋮] | ||
350 | "### | ||
335 | ); | 351 | ); |
336 | } | 352 | } |
337 | 353 | ||
@@ -346,16 +362,18 @@ mod tests { | |||
346 | }; | 362 | }; |
347 | ", | 363 | ", |
348 | ), | 364 | ), |
349 | @r###"[ | 365 | @r###" |
350 | CompletionItem { | 366 | ⋮[ |
351 | label: "the_field", | 367 | ⋮ CompletionItem { |
352 | source_range: [106; 106), | 368 | ⋮ label: "the_field", |
353 | delete: [106; 106), | 369 | ⋮ source_range: [106; 106), |
354 | insert: "the_field", | 370 | ⋮ delete: [106; 106), |
355 | kind: Field, | 371 | ⋮ insert: "the_field", |
356 | detail: "u32" | 372 | ⋮ kind: Field, |
357 | } | 373 | ⋮ detail: "u32", |
358 | ]"### | 374 | ⋮ }, |
375 | ⋮] | ||
376 | "### | ||
359 | ); | 377 | ); |
360 | } | 378 | } |
361 | } | 379 | } |
diff --git a/crates/ra_ide_api/src/completion/complete_fn_param.rs b/crates/ra_ide_api/src/completion/complete_fn_param.rs index 85ef62f52..d738ffc13 100644 --- a/crates/ra_ide_api/src/completion/complete_fn_param.rs +++ b/crates/ra_ide_api/src/completion/complete_fn_param.rs | |||
@@ -71,15 +71,17 @@ mod tests { | |||
71 | fn baz(file<|>) {} | 71 | fn baz(file<|>) {} |
72 | ", | 72 | ", |
73 | ), | 73 | ), |
74 | @r###"[ | 74 | @r###" |
75 | CompletionItem { | 75 | ⋮[ |
76 | label: "file_id: FileId", | 76 | ⋮ CompletionItem { |
77 | source_range: [110; 114), | 77 | ⋮ label: "file_id: FileId", |
78 | delete: [110; 114), | 78 | ⋮ source_range: [110; 114), |
79 | insert: "file_id: FileId", | 79 | ⋮ delete: [110; 114), |
80 | lookup: "file_id" | 80 | ⋮ insert: "file_id: FileId", |
81 | } | 81 | ⋮ lookup: "file_id", |
82 | ]"### | 82 | ⋮ }, |
83 | ⋮] | ||
84 | "### | ||
83 | ); | 85 | ); |
84 | } | 86 | } |
85 | 87 | ||
@@ -93,15 +95,17 @@ mod tests { | |||
93 | fn baz(file<|>, x: i32) {} | 95 | fn baz(file<|>, x: i32) {} |
94 | ", | 96 | ", |
95 | ), | 97 | ), |
96 | @r###"[ | 98 | @r###" |
97 | CompletionItem { | 99 | ⋮[ |
98 | label: "file_id: FileId", | 100 | ⋮ CompletionItem { |
99 | source_range: [110; 114), | 101 | ⋮ label: "file_id: FileId", |
100 | delete: [110; 114), | 102 | ⋮ source_range: [110; 114), |
101 | insert: "file_id: FileId", | 103 | ⋮ delete: [110; 114), |
102 | lookup: "file_id" | 104 | ⋮ insert: "file_id: FileId", |
103 | } | 105 | ⋮ lookup: "file_id", |
104 | ]"### | 106 | ⋮ }, |
107 | ⋮] | ||
108 | "### | ||
105 | ); | 109 | ); |
106 | } | 110 | } |
107 | 111 | ||
@@ -118,15 +122,17 @@ mod tests { | |||
118 | } | 122 | } |
119 | ", | 123 | ", |
120 | ), | 124 | ), |
121 | @r###"[ | 125 | @r###" |
122 | CompletionItem { | 126 | ⋮[ |
123 | label: "file_id: FileId", | 127 | ⋮ CompletionItem { |
124 | source_range: [289; 293), | 128 | ⋮ label: "file_id: FileId", |
125 | delete: [289; 293), | 129 | ⋮ source_range: [289; 293), |
126 | insert: "file_id: FileId", | 130 | ⋮ delete: [289; 293), |
127 | lookup: "file_id" | 131 | ⋮ insert: "file_id: FileId", |
128 | } | 132 | ⋮ lookup: "file_id", |
129 | ]"### | 133 | ⋮ }, |
134 | ⋮] | ||
135 | "### | ||
130 | ); | 136 | ); |
131 | } | 137 | } |
132 | } | 138 | } |
diff --git a/crates/ra_ide_api/src/completion/complete_pattern.rs b/crates/ra_ide_api/src/completion/complete_pattern.rs index 0ef248687..74833a756 100644 --- a/crates/ra_ide_api/src/completion/complete_pattern.rs +++ b/crates/ra_ide_api/src/completion/complete_pattern.rs | |||
@@ -53,35 +53,37 @@ mod tests { | |||
53 | } | 53 | } |
54 | ", | 54 | ", |
55 | ); | 55 | ); |
56 | assert_debug_snapshot_matches!(completions, @r###"[ | 56 | assert_debug_snapshot_matches!(completions, @r###" |
57 | CompletionItem { | 57 | ⋮[ |
58 | label: "E", | 58 | ⋮ CompletionItem { |
59 | source_range: [246; 246), | 59 | ⋮ label: "E", |
60 | delete: [246; 246), | 60 | ⋮ source_range: [246; 246), |
61 | insert: "E", | 61 | ⋮ delete: [246; 246), |
62 | kind: Enum | 62 | ⋮ insert: "E", |
63 | }, | 63 | ⋮ kind: Enum, |
64 | CompletionItem { | 64 | ⋮ }, |
65 | label: "X", | 65 | ⋮ CompletionItem { |
66 | source_range: [246; 246), | 66 | ⋮ label: "X", |
67 | delete: [246; 246), | 67 | ⋮ source_range: [246; 246), |
68 | insert: "X", | 68 | ⋮ delete: [246; 246), |
69 | kind: EnumVariant | 69 | ⋮ insert: "X", |
70 | }, | 70 | ⋮ kind: EnumVariant, |
71 | CompletionItem { | 71 | ⋮ }, |
72 | label: "Z", | 72 | ⋮ CompletionItem { |
73 | source_range: [246; 246), | 73 | ⋮ label: "Z", |
74 | delete: [246; 246), | 74 | ⋮ source_range: [246; 246), |
75 | insert: "Z", | 75 | ⋮ delete: [246; 246), |
76 | kind: Const | 76 | ⋮ insert: "Z", |
77 | }, | 77 | ⋮ kind: Const, |
78 | CompletionItem { | 78 | ⋮ }, |
79 | label: "m", | 79 | ⋮ CompletionItem { |
80 | source_range: [246; 246), | 80 | ⋮ label: "m", |
81 | delete: [246; 246), | 81 | ⋮ source_range: [246; 246), |
82 | insert: "m", | 82 | ⋮ delete: [246; 246), |
83 | kind: Module | 83 | ⋮ insert: "m", |
84 | } | 84 | ⋮ kind: Module, |
85 | ]"###); | 85 | ⋮ }, |
86 | ⋮] | ||
87 | "###); | ||
86 | } | 88 | } |
87 | } | 89 | } |
diff --git a/crates/ra_ide_api/src/completion/complete_struct_literal.rs b/crates/ra_ide_api/src/completion/complete_struct_literal.rs index 48fbf67f7..1eeea58f6 100644 --- a/crates/ra_ide_api/src/completion/complete_struct_literal.rs +++ b/crates/ra_ide_api/src/completion/complete_struct_literal.rs | |||
@@ -20,6 +20,7 @@ pub(super) fn complete_struct_literal(acc: &mut Completions, ctx: &CompletionCon | |||
20 | } | 20 | } |
21 | 21 | ||
22 | // FIXME unions | 22 | // FIXME unions |
23 | AdtDef::Union(_) => (), | ||
23 | AdtDef::Enum(_) => (), | 24 | AdtDef::Enum(_) => (), |
24 | }; | 25 | }; |
25 | } | 26 | } |
@@ -43,15 +44,17 @@ mod tests { | |||
43 | } | 44 | } |
44 | ", | 45 | ", |
45 | ); | 46 | ); |
46 | assert_debug_snapshot_matches!(completions, @r###"[ | 47 | assert_debug_snapshot_matches!(completions, @r###" |
47 | CompletionItem { | 48 | ⋮[ |
48 | label: "the_field", | 49 | ⋮ CompletionItem { |
49 | source_range: [83; 86), | 50 | ⋮ label: "the_field", |
50 | delete: [83; 86), | 51 | ⋮ source_range: [83; 86), |
51 | insert: "the_field", | 52 | ⋮ delete: [83; 86), |
52 | kind: Field, | 53 | ⋮ insert: "the_field", |
53 | detail: "u32" | 54 | ⋮ kind: Field, |
54 | } | 55 | ⋮ detail: "u32", |
55 | ]"###); | 56 | ⋮ }, |
57 | ⋮] | ||
58 | "###); | ||
56 | } | 59 | } |
57 | } | 60 | } |
diff --git a/crates/ra_ide_api/src/completion/presentation.rs b/crates/ra_ide_api/src/completion/presentation.rs index 9aa346688..064d379a4 100644 --- a/crates/ra_ide_api/src/completion/presentation.rs +++ b/crates/ra_ide_api/src/completion/presentation.rs | |||
@@ -63,6 +63,7 @@ impl Completions { | |||
63 | return self.add_function_with_name(ctx, Some(local_name), *func); | 63 | return self.add_function_with_name(ctx, Some(local_name), *func); |
64 | } | 64 | } |
65 | Resolution::Def(Struct(it)) => (CompletionItemKind::Struct, it.docs(ctx.db)), | 65 | Resolution::Def(Struct(it)) => (CompletionItemKind::Struct, it.docs(ctx.db)), |
66 | Resolution::Def(Union(it)) => (CompletionItemKind::Struct, it.docs(ctx.db)), | ||
66 | Resolution::Def(Enum(it)) => (CompletionItemKind::Enum, it.docs(ctx.db)), | 67 | Resolution::Def(Enum(it)) => (CompletionItemKind::Enum, it.docs(ctx.db)), |
67 | Resolution::Def(EnumVariant(it)) => (CompletionItemKind::EnumVariant, it.docs(ctx.db)), | 68 | Resolution::Def(EnumVariant(it)) => (CompletionItemKind::EnumVariant, it.docs(ctx.db)), |
68 | Resolution::Def(Const(it)) => (CompletionItemKind::Const, it.docs(ctx.db)), | 69 | Resolution::Def(Const(it)) => (CompletionItemKind::Const, it.docs(ctx.db)), |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__bindings_from_for.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__bindings_from_for.snap index bd7f99f71..e9b717a45 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__bindings_from_for.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__bindings_from_for.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.132341107Z" | 2 | created: "2019-05-23T22:23:35.119822026Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -11,13 +11,13 @@ expression: kind_completions | |||
11 | delete: [83; 83), | 11 | delete: [83; 83), |
12 | insert: "quux()$0", | 12 | insert: "quux()$0", |
13 | kind: Function, | 13 | kind: Function, |
14 | detail: "fn quux()" | 14 | detail: "fn quux()", |
15 | }, | 15 | }, |
16 | CompletionItem { | 16 | CompletionItem { |
17 | label: "x", | 17 | label: "x", |
18 | source_range: [83; 83), | 18 | source_range: [83; 83), |
19 | delete: [83; 83), | 19 | delete: [83; 83), |
20 | insert: "x", | 20 | insert: "x", |
21 | kind: Binding | 21 | kind: Binding, |
22 | } | 22 | }, |
23 | ] | 23 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__bindings_from_if_let.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__bindings_from_if_let.snap index 3b374c4de..2a22201ad 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__bindings_from_if_let.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__bindings_from_if_let.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.126809445Z" | 2 | created: "2019-05-23T22:23:35.122168608Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,14 +10,14 @@ expression: kind_completions | |||
10 | source_range: [214; 214), | 10 | source_range: [214; 214), |
11 | delete: [214; 214), | 11 | delete: [214; 214), |
12 | insert: "a", | 12 | insert: "a", |
13 | kind: Binding | 13 | kind: Binding, |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "b", | 16 | label: "b", |
17 | source_range: [214; 214), | 17 | source_range: [214; 214), |
18 | delete: [214; 214), | 18 | delete: [214; 214), |
19 | insert: "b", | 19 | insert: "b", |
20 | kind: Binding | 20 | kind: Binding, |
21 | }, | 21 | }, |
22 | CompletionItem { | 22 | CompletionItem { |
23 | label: "quux", | 23 | label: "quux", |
@@ -25,6 +25,6 @@ expression: kind_completions | |||
25 | delete: [214; 214), | 25 | delete: [214; 214), |
26 | insert: "quux()$0", | 26 | insert: "quux()$0", |
27 | kind: Function, | 27 | kind: Function, |
28 | detail: "fn quux()" | 28 | detail: "fn quux()", |
29 | } | 29 | }, |
30 | ] | 30 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__bindings_from_let.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__bindings_from_let.snap index 173f5319a..b9a5dc9c8 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__bindings_from_let.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__bindings_from_let.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.126696322Z" | 2 | created: "2019-05-23T22:23:35.122797188Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -11,20 +11,20 @@ expression: kind_completions | |||
11 | delete: [79; 79), | 11 | delete: [79; 79), |
12 | insert: "quux($0)", | 12 | insert: "quux($0)", |
13 | kind: Function, | 13 | kind: Function, |
14 | detail: "fn quux(x: i32)" | 14 | detail: "fn quux(x: i32)", |
15 | }, | 15 | }, |
16 | CompletionItem { | 16 | CompletionItem { |
17 | label: "x", | 17 | label: "x", |
18 | source_range: [79; 79), | 18 | source_range: [79; 79), |
19 | delete: [79; 79), | 19 | delete: [79; 79), |
20 | insert: "x", | 20 | insert: "x", |
21 | kind: Binding | 21 | kind: Binding, |
22 | }, | 22 | }, |
23 | CompletionItem { | 23 | CompletionItem { |
24 | label: "y", | 24 | label: "y", |
25 | source_range: [79; 79), | 25 | source_range: [79; 79), |
26 | delete: [79; 79), | 26 | delete: [79; 79), |
27 | insert: "y", | 27 | insert: "y", |
28 | kind: Binding | 28 | kind: Binding, |
29 | } | 29 | }, |
30 | ] | 30 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops1.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops1.snap index 42ff02469..b6f95c1ff 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops1.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops1.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:23.976673150Z" | 2 | created: "2019-05-23T22:23:35.067956470Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,48 +10,48 @@ expression: kind_completions | |||
10 | source_range: [55; 55), | 10 | source_range: [55; 55), |
11 | delete: [55; 55), | 11 | delete: [55; 55), |
12 | insert: "break;", | 12 | insert: "break;", |
13 | kind: Keyword | 13 | kind: Keyword, |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "continue", | 16 | label: "continue", |
17 | source_range: [55; 55), | 17 | source_range: [55; 55), |
18 | delete: [55; 55), | 18 | delete: [55; 55), |
19 | insert: "continue;", | 19 | insert: "continue;", |
20 | kind: Keyword | 20 | kind: Keyword, |
21 | }, | 21 | }, |
22 | CompletionItem { | 22 | CompletionItem { |
23 | label: "if", | 23 | label: "if", |
24 | source_range: [55; 55), | 24 | source_range: [55; 55), |
25 | delete: [55; 55), | 25 | delete: [55; 55), |
26 | insert: "if $0 {}", | 26 | insert: "if $0 {}", |
27 | kind: Keyword | 27 | kind: Keyword, |
28 | }, | 28 | }, |
29 | CompletionItem { | 29 | CompletionItem { |
30 | label: "loop", | 30 | label: "loop", |
31 | source_range: [55; 55), | 31 | source_range: [55; 55), |
32 | delete: [55; 55), | 32 | delete: [55; 55), |
33 | insert: "loop {$0}", | 33 | insert: "loop {$0}", |
34 | kind: Keyword | 34 | kind: Keyword, |
35 | }, | 35 | }, |
36 | CompletionItem { | 36 | CompletionItem { |
37 | label: "match", | 37 | label: "match", |
38 | source_range: [55; 55), | 38 | source_range: [55; 55), |
39 | delete: [55; 55), | 39 | delete: [55; 55), |
40 | insert: "match $0 {}", | 40 | insert: "match $0 {}", |
41 | kind: Keyword | 41 | kind: Keyword, |
42 | }, | 42 | }, |
43 | CompletionItem { | 43 | CompletionItem { |
44 | label: "return", | 44 | label: "return", |
45 | source_range: [55; 55), | 45 | source_range: [55; 55), |
46 | delete: [55; 55), | 46 | delete: [55; 55), |
47 | insert: "return $0;", | 47 | insert: "return $0;", |
48 | kind: Keyword | 48 | kind: Keyword, |
49 | }, | 49 | }, |
50 | CompletionItem { | 50 | CompletionItem { |
51 | label: "while", | 51 | label: "while", |
52 | source_range: [55; 55), | 52 | source_range: [55; 55), |
53 | delete: [55; 55), | 53 | delete: [55; 55), |
54 | insert: "while $0 {}", | 54 | insert: "while $0 {}", |
55 | kind: Keyword | 55 | kind: Keyword, |
56 | } | 56 | }, |
57 | ] | 57 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops2.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops2.snap index 057ff8a7a..9b37478ef 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops2.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops2.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.068967569Z" | 2 | created: "2019-05-23T22:44:10.859967190Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,34 +10,34 @@ expression: kind_completions | |||
10 | source_range: [60; 60), | 10 | source_range: [60; 60), |
11 | delete: [60; 60), | 11 | delete: [60; 60), |
12 | insert: "if $0 {}", | 12 | insert: "if $0 {}", |
13 | kind: Keyword | 13 | kind: Keyword, |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "loop", | 16 | label: "loop", |
17 | source_range: [60; 60), | 17 | source_range: [60; 60), |
18 | delete: [60; 60), | 18 | delete: [60; 60), |
19 | insert: "loop {$0}", | 19 | insert: "loop {$0}", |
20 | kind: Keyword | 20 | kind: Keyword, |
21 | }, | 21 | }, |
22 | CompletionItem { | 22 | CompletionItem { |
23 | label: "match", | 23 | label: "match", |
24 | source_range: [60; 60), | 24 | source_range: [60; 60), |
25 | delete: [60; 60), | 25 | delete: [60; 60), |
26 | insert: "match $0 {}", | 26 | insert: "match $0 {}", |
27 | kind: Keyword | 27 | kind: Keyword, |
28 | }, | 28 | }, |
29 | CompletionItem { | 29 | CompletionItem { |
30 | label: "return", | 30 | label: "return", |
31 | source_range: [60; 60), | 31 | source_range: [60; 60), |
32 | delete: [60; 60), | 32 | delete: [60; 60), |
33 | insert: "return $0;", | 33 | insert: "return $0;", |
34 | kind: Keyword | 34 | kind: Keyword, |
35 | }, | 35 | }, |
36 | CompletionItem { | 36 | CompletionItem { |
37 | label: "while", | 37 | label: "while", |
38 | source_range: [60; 60), | 38 | source_range: [60; 60), |
39 | delete: [60; 60), | 39 | delete: [60; 60), |
40 | insert: "while $0 {}", | 40 | insert: "while $0 {}", |
41 | kind: Keyword | 41 | kind: Keyword, |
42 | } | 42 | }, |
43 | ] | 43 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_prelude.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_prelude.snap index 16126ee77..b339c6c5f 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_prelude.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_prelude.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.180517434Z" | 2 | created: "2019-05-23T22:23:35.139262926Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,7 +10,7 @@ expression: kind_completions | |||
10 | source_range: [18; 18), | 10 | source_range: [18; 18), |
11 | delete: [18; 18), | 11 | delete: [18; 18), |
12 | insert: "Option", | 12 | insert: "Option", |
13 | kind: Struct | 13 | kind: Struct, |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "foo", | 16 | label: "foo", |
@@ -18,13 +18,13 @@ expression: kind_completions | |||
18 | delete: [18; 18), | 18 | delete: [18; 18), |
19 | insert: "foo()$0", | 19 | insert: "foo()$0", |
20 | kind: Function, | 20 | kind: Function, |
21 | detail: "fn foo()" | 21 | detail: "fn foo()", |
22 | }, | 22 | }, |
23 | CompletionItem { | 23 | CompletionItem { |
24 | label: "std", | 24 | label: "std", |
25 | source_range: [18; 18), | 25 | source_range: [18; 18), |
26 | delete: [18; 18), | 26 | delete: [18; 18), |
27 | insert: "std", | 27 | insert: "std", |
28 | kind: Module | 28 | kind: Module, |
29 | } | 29 | }, |
30 | ] | 30 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_use_paths_across_crates.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_use_paths_across_crates.snap index 2420e7744..113deafb1 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_use_paths_across_crates.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_use_paths_across_crates.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.118807216Z" | 2 | created: "2019-05-23T22:23:35.108690807Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,6 +10,6 @@ expression: kind_completions | |||
10 | source_range: [9; 9), | 10 | source_range: [9; 9), |
11 | delete: [9; 9), | 11 | delete: [9; 9), |
12 | insert: "bar", | 12 | insert: "bar", |
13 | kind: Module | 13 | kind: Module, |
14 | } | 14 | }, |
15 | ] | 15 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__deeply_nested_use_tree.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__deeply_nested_use_tree.snap index c472f7965..aacdeb763 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__deeply_nested_use_tree.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__deeply_nested_use_tree.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.044567777Z" | 2 | created: "2019-05-23T22:23:35.085633034Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,6 +10,6 @@ expression: kind_completions | |||
10 | source_range: [23; 25), | 10 | source_range: [23; 25), |
11 | delete: [23; 25), | 11 | delete: [23; 25), |
12 | insert: "Spam", | 12 | insert: "Spam", |
13 | kind: Struct | 13 | kind: Struct, |
14 | } | 14 | }, |
15 | ] | 15 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_add_semi_after_return_if_not_a_statement.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_add_semi_after_return_if_not_a_statement.snap index 97bd76c49..9d320c715 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_add_semi_after_return_if_not_a_statement.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_add_semi_after_return_if_not_a_statement.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:23.987788705Z" | 2 | created: "2019-05-23T22:23:35.081993214Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,34 +10,34 @@ expression: kind_completions | |||
10 | source_range: [85; 85), | 10 | source_range: [85; 85), |
11 | delete: [85; 85), | 11 | delete: [85; 85), |
12 | insert: "if $0 {}", | 12 | insert: "if $0 {}", |
13 | kind: Keyword | 13 | kind: Keyword, |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "loop", | 16 | label: "loop", |
17 | source_range: [85; 85), | 17 | source_range: [85; 85), |
18 | delete: [85; 85), | 18 | delete: [85; 85), |
19 | insert: "loop {$0}", | 19 | insert: "loop {$0}", |
20 | kind: Keyword | 20 | kind: Keyword, |
21 | }, | 21 | }, |
22 | CompletionItem { | 22 | CompletionItem { |
23 | label: "match", | 23 | label: "match", |
24 | source_range: [85; 85), | 24 | source_range: [85; 85), |
25 | delete: [85; 85), | 25 | delete: [85; 85), |
26 | insert: "match $0 {}", | 26 | insert: "match $0 {}", |
27 | kind: Keyword | 27 | kind: Keyword, |
28 | }, | 28 | }, |
29 | CompletionItem { | 29 | CompletionItem { |
30 | label: "return", | 30 | label: "return", |
31 | source_range: [85; 85), | 31 | source_range: [85; 85), |
32 | delete: [85; 85), | 32 | delete: [85; 85), |
33 | insert: "return $0", | 33 | insert: "return $0", |
34 | kind: Keyword | 34 | kind: Keyword, |
35 | }, | 35 | }, |
36 | CompletionItem { | 36 | CompletionItem { |
37 | label: "while", | 37 | label: "while", |
38 | source_range: [85; 85), | 38 | source_range: [85; 85), |
39 | delete: [85; 85), | 39 | delete: [85; 85), |
40 | insert: "while $0 {}", | 40 | insert: "while $0 {}", |
41 | kind: Keyword | 41 | kind: Keyword, |
42 | } | 42 | }, |
43 | ] | 43 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_render_function_parens_if_already_call.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_render_function_parens_if_already_call.snap index 1de0efb5b..46bea2ccd 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_render_function_parens_if_already_call.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_render_function_parens_if_already_call.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.211680376Z" | 2 | created: "2019-05-23T22:23:35.158296242Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -11,7 +11,7 @@ expression: kind_completions | |||
11 | delete: [35; 39), | 11 | delete: [35; 39), |
12 | insert: "frobnicate", | 12 | insert: "frobnicate", |
13 | kind: Function, | 13 | kind: Function, |
14 | detail: "fn frobnicate()" | 14 | detail: "fn frobnicate()", |
15 | }, | 15 | }, |
16 | CompletionItem { | 16 | CompletionItem { |
17 | label: "main", | 17 | label: "main", |
@@ -19,6 +19,6 @@ expression: kind_completions | |||
19 | delete: [35; 39), | 19 | delete: [35; 39), |
20 | insert: "main", | 20 | insert: "main", |
21 | kind: Function, | 21 | kind: Function, |
22 | detail: "fn main()" | 22 | detail: "fn main()", |
23 | } | 23 | }, |
24 | ] | 24 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_render_function_parens_if_already_call_assoc_fn.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_render_function_parens_if_already_call_assoc_fn.snap index 19375ea95..b09a6745e 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_render_function_parens_if_already_call_assoc_fn.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_render_function_parens_if_already_call_assoc_fn.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-24T16:33:48.008220694Z" | 2 | created: "2019-05-23T22:44:10.920136527Z" |
3 | creator: insta@0.6.3 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -11,6 +11,6 @@ expression: kind_completions | |||
11 | delete: [67; 69), | 11 | delete: [67; 69), |
12 | insert: "new", | 12 | insert: "new", |
13 | kind: Function, | 13 | kind: Function, |
14 | detail: "fn new() -> Foo" | 14 | detail: "fn new() -> Foo", |
15 | } | 15 | }, |
16 | ] | 16 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_render_function_parens_in_use_item.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_render_function_parens_in_use_item.snap index ef77816ec..84ccc8160 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_render_function_parens_in_use_item.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_render_function_parens_in_use_item.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.213677341Z" | 2 | created: "2019-05-23T22:23:35.154795561Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -11,6 +11,6 @@ expression: kind_completions | |||
11 | delete: [40; 41), | 11 | delete: [40; 41), |
12 | insert: "foo", | 12 | insert: "foo", |
13 | kind: Function, | 13 | kind: Function, |
14 | detail: "pub fn foo()" | 14 | detail: "pub fn foo()", |
15 | } | 15 | }, |
16 | ] | 16 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_show_both_completions_for_shadowing.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_show_both_completions_for_shadowing.snap index 34adcda6c..57434210d 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_show_both_completions_for_shadowing.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_show_both_completions_for_shadowing.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-04-04T14:52:24.531844100Z" | 2 | created: "2019-05-23T22:23:35.142044205Z" |
3 | creator: insta@0.7.4 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,7 +10,7 @@ expression: kind_completions | |||
10 | source_range: [126; 126), | 10 | source_range: [126; 126), |
11 | delete: [126; 126), | 11 | delete: [126; 126), |
12 | insert: "bar", | 12 | insert: "bar", |
13 | kind: Binding | 13 | kind: Binding, |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "foo", | 16 | label: "foo", |
@@ -18,6 +18,6 @@ expression: kind_completions | |||
18 | delete: [126; 126), | 18 | delete: [126; 126), |
19 | insert: "foo()$0", | 19 | insert: "foo()$0", |
20 | kind: Function, | 20 | kind: Function, |
21 | detail: "fn foo()" | 21 | detail: "fn foo()", |
22 | } | 22 | }, |
23 | ] | 23 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__enum_variant.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__enum_variant.snap index 1df121523..e40217ca8 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__enum_variant.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__enum_variant.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.045355450Z" | 2 | created: "2019-05-23T22:23:35.090178265Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -13,8 +13,8 @@ expression: kind_completions | |||
13 | kind: EnumVariant, | 13 | kind: EnumVariant, |
14 | detail: "(i32)", | 14 | detail: "(i32)", |
15 | documentation: Documentation( | 15 | documentation: Documentation( |
16 | "Bar Variant with i32" | 16 | "Bar Variant with i32", |
17 | ) | 17 | ), |
18 | }, | 18 | }, |
19 | CompletionItem { | 19 | CompletionItem { |
20 | label: "Foo", | 20 | label: "Foo", |
@@ -24,7 +24,7 @@ expression: kind_completions | |||
24 | kind: EnumVariant, | 24 | kind: EnumVariant, |
25 | detail: "()", | 25 | detail: "()", |
26 | documentation: Documentation( | 26 | documentation: Documentation( |
27 | "Foo Variant" | 27 | "Foo Variant", |
28 | ) | 28 | ), |
29 | } | 29 | }, |
30 | ] | 30 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__enum_variant_with_details.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__enum_variant_with_details.snap index daccd9fba..e09d7988a 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__enum_variant_with_details.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__enum_variant_with_details.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-04-02T07:43:12.954637543Z" | 2 | created: "2019-05-23T22:23:35.091325331Z" |
3 | creator: insta@0.7.4 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -13,8 +13,8 @@ expression: kind_completions | |||
13 | kind: EnumVariant, | 13 | kind: EnumVariant, |
14 | detail: "(i32, u32)", | 14 | detail: "(i32, u32)", |
15 | documentation: Documentation( | 15 | documentation: Documentation( |
16 | "Bar Variant with i32 and u32" | 16 | "Bar Variant with i32 and u32", |
17 | ) | 17 | ), |
18 | }, | 18 | }, |
19 | CompletionItem { | 19 | CompletionItem { |
20 | label: "Foo", | 20 | label: "Foo", |
@@ -24,8 +24,8 @@ expression: kind_completions | |||
24 | kind: EnumVariant, | 24 | kind: EnumVariant, |
25 | detail: "()", | 25 | detail: "()", |
26 | documentation: Documentation( | 26 | documentation: Documentation( |
27 | "Foo Variant (empty)" | 27 | "Foo Variant (empty)", |
28 | ) | 28 | ), |
29 | }, | 29 | }, |
30 | CompletionItem { | 30 | CompletionItem { |
31 | label: "S", | 31 | label: "S", |
@@ -35,7 +35,7 @@ expression: kind_completions | |||
35 | kind: EnumVariant, | 35 | kind: EnumVariant, |
36 | detail: "(S)", | 36 | detail: "(S)", |
37 | documentation: Documentation( | 37 | documentation: Documentation( |
38 | "" | 38 | "", |
39 | ) | 39 | ), |
40 | } | 40 | }, |
41 | ] | 41 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__extern_prelude.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__extern_prelude.snap index 0d36fd603..b9449a76c 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__extern_prelude.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__extern_prelude.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.137183638Z" | 2 | created: "2019-05-23T22:23:35.123197049Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,6 +10,6 @@ expression: kind_completions | |||
10 | source_range: [4; 4), | 10 | source_range: [4; 4), |
11 | delete: [4; 4), | 11 | delete: [4; 4), |
12 | insert: "other_crate", | 12 | insert: "other_crate", |
13 | kind: Module | 13 | kind: Module, |
14 | } | 14 | }, |
15 | ] | 15 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__generic_params.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__generic_params.snap index 210e5a02d..eb1a4151a 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__generic_params.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__generic_params.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.143253235Z" | 2 | created: "2019-05-23T22:23:35.123825399Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,7 +10,7 @@ expression: kind_completions | |||
10 | source_range: [44; 44), | 10 | source_range: [44; 44), |
11 | delete: [44; 44), | 11 | delete: [44; 44), |
12 | insert: "T", | 12 | insert: "T", |
13 | kind: TypeParam | 13 | kind: TypeParam, |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "quux", | 16 | label: "quux", |
@@ -18,6 +18,6 @@ expression: kind_completions | |||
18 | delete: [44; 44), | 18 | delete: [44; 44), |
19 | insert: "quux()$0", | 19 | insert: "quux()$0", |
20 | kind: Function, | 20 | kind: Function, |
21 | detail: "fn quux<T>()" | 21 | detail: "fn quux<T>()", |
22 | } | 22 | }, |
23 | ] | 23 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__generic_params_in_struct.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__generic_params_in_struct.snap index ab8c30446..52f08267f 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__generic_params_in_struct.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__generic_params_in_struct.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.149424158Z" | 2 | created: "2019-05-23T22:23:35.130778739Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,13 +10,13 @@ expression: kind_completions | |||
10 | source_range: [46; 46), | 10 | source_range: [46; 46), |
11 | delete: [46; 46), | 11 | delete: [46; 46), |
12 | insert: "T", | 12 | insert: "T", |
13 | kind: TypeParam | 13 | kind: TypeParam, |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "X", | 16 | label: "X", |
17 | source_range: [46; 46), | 17 | source_range: [46; 46), |
18 | delete: [46; 46), | 18 | delete: [46; 46), |
19 | insert: "X", | 19 | insert: "X", |
20 | kind: Struct | 20 | kind: Struct, |
21 | } | 21 | }, |
22 | ] | 22 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__inserts_parens_for_function_calls1.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__inserts_parens_for_function_calls1.snap index a4fc447b2..c795b9aae 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__inserts_parens_for_function_calls1.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__inserts_parens_for_function_calls1.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.224510370Z" | 2 | created: "2019-05-23T22:23:35.156115632Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -11,7 +11,7 @@ expression: kind_completions | |||
11 | delete: [53; 56), | 11 | delete: [53; 56), |
12 | insert: "main()$0", | 12 | insert: "main()$0", |
13 | kind: Function, | 13 | kind: Function, |
14 | detail: "fn main()" | 14 | detail: "fn main()", |
15 | }, | 15 | }, |
16 | CompletionItem { | 16 | CompletionItem { |
17 | label: "no_args", | 17 | label: "no_args", |
@@ -19,6 +19,6 @@ expression: kind_completions | |||
19 | delete: [53; 56), | 19 | delete: [53; 56), |
20 | insert: "no_args()$0", | 20 | insert: "no_args()$0", |
21 | kind: Function, | 21 | kind: Function, |
22 | detail: "fn no_args()" | 22 | detail: "fn no_args()", |
23 | } | 23 | }, |
24 | ] | 24 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__inserts_parens_for_function_calls2.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__inserts_parens_for_function_calls2.snap index b124355d5..b49a838e0 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__inserts_parens_for_function_calls2.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__inserts_parens_for_function_calls2.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.267013140Z" | 2 | created: "2019-05-23T22:44:10.916806744Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -11,7 +11,7 @@ expression: kind_completions | |||
11 | delete: [72; 77), | 11 | delete: [72; 77), |
12 | insert: "main()$0", | 12 | insert: "main()$0", |
13 | kind: Function, | 13 | kind: Function, |
14 | detail: "fn main()" | 14 | detail: "fn main()", |
15 | }, | 15 | }, |
16 | CompletionItem { | 16 | CompletionItem { |
17 | label: "with_args", | 17 | label: "with_args", |
@@ -19,6 +19,6 @@ expression: kind_completions | |||
19 | delete: [72; 77), | 19 | delete: [72; 77), |
20 | insert: "with_args($0)", | 20 | insert: "with_args($0)", |
21 | kind: Function, | 21 | kind: Function, |
22 | detail: "fn with_args(x: i32, y: String)" | 22 | detail: "fn with_args(x: i32, y: String)", |
23 | } | 23 | }, |
24 | ] | 24 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__inserts_parens_for_function_calls3.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__inserts_parens_for_function_calls3.snap index fec729d48..b62cb7aa1 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__inserts_parens_for_function_calls3.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__inserts_parens_for_function_calls3.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.303360770Z" | 2 | created: "2019-05-23T22:44:40.543731193Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -11,6 +11,6 @@ expression: kind_completions | |||
11 | delete: [139; 140), | 11 | delete: [139; 140), |
12 | insert: "foo()$0", | 12 | insert: "foo()$0", |
13 | kind: Method, | 13 | kind: Method, |
14 | detail: "fn foo(&self)" | 14 | detail: "fn foo(&self)", |
15 | } | 15 | }, |
16 | ] | 16 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function1.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function1.snap index 045e2a4e6..34a44bb70 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function1.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function1.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:23.987788720Z" | 2 | created: "2019-05-23T22:23:35.075690846Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,34 +10,34 @@ expression: kind_completions | |||
10 | source_range: [41; 41), | 10 | source_range: [41; 41), |
11 | delete: [41; 41), | 11 | delete: [41; 41), |
12 | insert: "if $0 {}", | 12 | insert: "if $0 {}", |
13 | kind: Keyword | 13 | kind: Keyword, |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "loop", | 16 | label: "loop", |
17 | source_range: [41; 41), | 17 | source_range: [41; 41), |
18 | delete: [41; 41), | 18 | delete: [41; 41), |
19 | insert: "loop {$0}", | 19 | insert: "loop {$0}", |
20 | kind: Keyword | 20 | kind: Keyword, |
21 | }, | 21 | }, |
22 | CompletionItem { | 22 | CompletionItem { |
23 | label: "match", | 23 | label: "match", |
24 | source_range: [41; 41), | 24 | source_range: [41; 41), |
25 | delete: [41; 41), | 25 | delete: [41; 41), |
26 | insert: "match $0 {}", | 26 | insert: "match $0 {}", |
27 | kind: Keyword | 27 | kind: Keyword, |
28 | }, | 28 | }, |
29 | CompletionItem { | 29 | CompletionItem { |
30 | label: "return", | 30 | label: "return", |
31 | source_range: [41; 41), | 31 | source_range: [41; 41), |
32 | delete: [41; 41), | 32 | delete: [41; 41), |
33 | insert: "return;", | 33 | insert: "return;", |
34 | kind: Keyword | 34 | kind: Keyword, |
35 | }, | 35 | }, |
36 | CompletionItem { | 36 | CompletionItem { |
37 | label: "while", | 37 | label: "while", |
38 | source_range: [41; 41), | 38 | source_range: [41; 41), |
39 | delete: [41; 41), | 39 | delete: [41; 41), |
40 | insert: "while $0 {}", | 40 | insert: "while $0 {}", |
41 | kind: Keyword | 41 | kind: Keyword, |
42 | } | 42 | }, |
43 | ] | 43 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function2.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function2.snap index b08efa522..ac744f362 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function2.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function2.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:23.984740354Z" | 2 | created: "2019-05-23T22:23:35.068799431Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,48 +10,48 @@ expression: kind_completions | |||
10 | source_range: [92; 92), | 10 | source_range: [92; 92), |
11 | delete: [92; 92), | 11 | delete: [92; 92), |
12 | insert: "else {$0}", | 12 | insert: "else {$0}", |
13 | kind: Keyword | 13 | kind: Keyword, |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "else if", | 16 | label: "else if", |
17 | source_range: [92; 92), | 17 | source_range: [92; 92), |
18 | delete: [92; 92), | 18 | delete: [92; 92), |
19 | insert: "else if $0 {}", | 19 | insert: "else if $0 {}", |
20 | kind: Keyword | 20 | kind: Keyword, |
21 | }, | 21 | }, |
22 | CompletionItem { | 22 | CompletionItem { |
23 | label: "if", | 23 | label: "if", |
24 | source_range: [92; 92), | 24 | source_range: [92; 92), |
25 | delete: [92; 92), | 25 | delete: [92; 92), |
26 | insert: "if $0 {}", | 26 | insert: "if $0 {}", |
27 | kind: Keyword | 27 | kind: Keyword, |
28 | }, | 28 | }, |
29 | CompletionItem { | 29 | CompletionItem { |
30 | label: "loop", | 30 | label: "loop", |
31 | source_range: [92; 92), | 31 | source_range: [92; 92), |
32 | delete: [92; 92), | 32 | delete: [92; 92), |
33 | insert: "loop {$0}", | 33 | insert: "loop {$0}", |
34 | kind: Keyword | 34 | kind: Keyword, |
35 | }, | 35 | }, |
36 | CompletionItem { | 36 | CompletionItem { |
37 | label: "match", | 37 | label: "match", |
38 | source_range: [92; 92), | 38 | source_range: [92; 92), |
39 | delete: [92; 92), | 39 | delete: [92; 92), |
40 | insert: "match $0 {}", | 40 | insert: "match $0 {}", |
41 | kind: Keyword | 41 | kind: Keyword, |
42 | }, | 42 | }, |
43 | CompletionItem { | 43 | CompletionItem { |
44 | label: "return", | 44 | label: "return", |
45 | source_range: [92; 92), | 45 | source_range: [92; 92), |
46 | delete: [92; 92), | 46 | delete: [92; 92), |
47 | insert: "return;", | 47 | insert: "return;", |
48 | kind: Keyword | 48 | kind: Keyword, |
49 | }, | 49 | }, |
50 | CompletionItem { | 50 | CompletionItem { |
51 | label: "while", | 51 | label: "while", |
52 | source_range: [92; 92), | 52 | source_range: [92; 92), |
53 | delete: [92; 92), | 53 | delete: [92; 92), |
54 | insert: "while $0 {}", | 54 | insert: "while $0 {}", |
55 | kind: Keyword | 55 | kind: Keyword, |
56 | } | 56 | }, |
57 | ] | 57 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function3.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function3.snap index e2b9214fb..1098ecf54 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function3.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function3.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.049699338Z" | 2 | created: "2019-05-23T22:23:35.085655258Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,34 +10,34 @@ expression: kind_completions | |||
10 | source_range: [48; 48), | 10 | source_range: [48; 48), |
11 | delete: [48; 48), | 11 | delete: [48; 48), |
12 | insert: "if $0 {}", | 12 | insert: "if $0 {}", |
13 | kind: Keyword | 13 | kind: Keyword, |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "loop", | 16 | label: "loop", |
17 | source_range: [48; 48), | 17 | source_range: [48; 48), |
18 | delete: [48; 48), | 18 | delete: [48; 48), |
19 | insert: "loop {$0}", | 19 | insert: "loop {$0}", |
20 | kind: Keyword | 20 | kind: Keyword, |
21 | }, | 21 | }, |
22 | CompletionItem { | 22 | CompletionItem { |
23 | label: "match", | 23 | label: "match", |
24 | source_range: [48; 48), | 24 | source_range: [48; 48), |
25 | delete: [48; 48), | 25 | delete: [48; 48), |
26 | insert: "match $0 {}", | 26 | insert: "match $0 {}", |
27 | kind: Keyword | 27 | kind: Keyword, |
28 | }, | 28 | }, |
29 | CompletionItem { | 29 | CompletionItem { |
30 | label: "return", | 30 | label: "return", |
31 | source_range: [48; 48), | 31 | source_range: [48; 48), |
32 | delete: [48; 48), | 32 | delete: [48; 48), |
33 | insert: "return $0;", | 33 | insert: "return $0;", |
34 | kind: Keyword | 34 | kind: Keyword, |
35 | }, | 35 | }, |
36 | CompletionItem { | 36 | CompletionItem { |
37 | label: "while", | 37 | label: "while", |
38 | source_range: [48; 48), | 38 | source_range: [48; 48), |
39 | delete: [48; 48), | 39 | delete: [48; 48), |
40 | insert: "while $0 {}", | 40 | insert: "while $0 {}", |
41 | kind: Keyword | 41 | kind: Keyword, |
42 | } | 42 | }, |
43 | ] | 43 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function4.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function4.snap index 1ea7eb5ce..3c5eca1ba 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function4.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function4.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.090949782Z" | 2 | created: "2019-05-23T22:44:10.869539856Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,34 +10,34 @@ expression: kind_completions | |||
10 | source_range: [41; 41), | 10 | source_range: [41; 41), |
11 | delete: [41; 41), | 11 | delete: [41; 41), |
12 | insert: "if $0 {}", | 12 | insert: "if $0 {}", |
13 | kind: Keyword | 13 | kind: Keyword, |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "loop", | 16 | label: "loop", |
17 | source_range: [41; 41), | 17 | source_range: [41; 41), |
18 | delete: [41; 41), | 18 | delete: [41; 41), |
19 | insert: "loop {$0}", | 19 | insert: "loop {$0}", |
20 | kind: Keyword | 20 | kind: Keyword, |
21 | }, | 21 | }, |
22 | CompletionItem { | 22 | CompletionItem { |
23 | label: "match", | 23 | label: "match", |
24 | source_range: [41; 41), | 24 | source_range: [41; 41), |
25 | delete: [41; 41), | 25 | delete: [41; 41), |
26 | insert: "match $0 {}", | 26 | insert: "match $0 {}", |
27 | kind: Keyword | 27 | kind: Keyword, |
28 | }, | 28 | }, |
29 | CompletionItem { | 29 | CompletionItem { |
30 | label: "return", | 30 | label: "return", |
31 | source_range: [41; 41), | 31 | source_range: [41; 41), |
32 | delete: [41; 41), | 32 | delete: [41; 41), |
33 | insert: "return;", | 33 | insert: "return;", |
34 | kind: Keyword | 34 | kind: Keyword, |
35 | }, | 35 | }, |
36 | CompletionItem { | 36 | CompletionItem { |
37 | label: "while", | 37 | label: "while", |
38 | source_range: [41; 41), | 38 | source_range: [41; 41), |
39 | delete: [41; 41), | 39 | delete: [41; 41), |
40 | insert: "while $0 {}", | 40 | insert: "while $0 {}", |
41 | kind: Keyword | 41 | kind: Keyword, |
42 | } | 42 | }, |
43 | ] | 43 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt1.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt1.snap index 76d5daf55..71d7e9de8 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt1.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt1.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:23.988755424Z" | 2 | created: "2019-05-23T22:23:35.066687241Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,20 +10,20 @@ expression: kind_completions | |||
10 | source_range: [17; 17), | 10 | source_range: [17; 17), |
11 | delete: [17; 17), | 11 | delete: [17; 17), |
12 | insert: "crate::", | 12 | insert: "crate::", |
13 | kind: Keyword | 13 | kind: Keyword, |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "self", | 16 | label: "self", |
17 | source_range: [17; 17), | 17 | source_range: [17; 17), |
18 | delete: [17; 17), | 18 | delete: [17; 17), |
19 | insert: "self", | 19 | insert: "self", |
20 | kind: Keyword | 20 | kind: Keyword, |
21 | }, | 21 | }, |
22 | CompletionItem { | 22 | CompletionItem { |
23 | label: "super", | 23 | label: "super", |
24 | source_range: [17; 17), | 24 | source_range: [17; 17), |
25 | delete: [17; 17), | 25 | delete: [17; 17), |
26 | insert: "super::", | 26 | insert: "super::", |
27 | kind: Keyword | 27 | kind: Keyword, |
28 | } | 28 | }, |
29 | ] | 29 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt2.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt2.snap index ee8bf4ca1..ad156fb44 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt2.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt2.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.030382527Z" | 2 | created: "2019-05-23T22:44:10.859494330Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,13 +10,13 @@ expression: kind_completions | |||
10 | source_range: [20; 20), | 10 | source_range: [20; 20), |
11 | delete: [20; 20), | 11 | delete: [20; 20), |
12 | insert: "self", | 12 | insert: "self", |
13 | kind: Keyword | 13 | kind: Keyword, |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "super", | 16 | label: "super", |
17 | source_range: [20; 20), | 17 | source_range: [20; 20), |
18 | delete: [20; 20), | 18 | delete: [20; 20), |
19 | insert: "super::", | 19 | insert: "super::", |
20 | kind: Keyword | 20 | kind: Keyword, |
21 | } | 21 | }, |
22 | ] | 22 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt3.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt3.snap index b44db276e..e7b11d532 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt3.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt3.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.073607133Z" | 2 | created: "2019-05-23T22:44:40.506690279Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,13 +10,13 @@ expression: kind_completions | |||
10 | source_range: [24; 24), | 10 | source_range: [24; 24), |
11 | delete: [24; 24), | 11 | delete: [24; 24), |
12 | insert: "self", | 12 | insert: "self", |
13 | kind: Keyword | 13 | kind: Keyword, |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "super", | 16 | label: "super", |
17 | source_range: [24; 24), | 17 | source_range: [24; 24), |
18 | delete: [24; 24), | 18 | delete: [24; 24), |
19 | insert: "super::", | 19 | insert: "super::", |
20 | kind: Keyword | 20 | kind: Keyword, |
21 | } | 21 | }, |
22 | ] | 22 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi1.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi1.snap index f220d35c2..e7069dc0c 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi1.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi1.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:23.989188654Z" | 2 | created: "2019-05-23T22:23:35.082403612Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,34 +10,34 @@ expression: kind_completions | |||
10 | source_range: [83; 83), | 10 | source_range: [83; 83), |
11 | delete: [83; 83), | 11 | delete: [83; 83), |
12 | insert: "if $0 {}", | 12 | insert: "if $0 {}", |
13 | kind: Keyword | 13 | kind: Keyword, |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "loop", | 16 | label: "loop", |
17 | source_range: [83; 83), | 17 | source_range: [83; 83), |
18 | delete: [83; 83), | 18 | delete: [83; 83), |
19 | insert: "loop {$0}", | 19 | insert: "loop {$0}", |
20 | kind: Keyword | 20 | kind: Keyword, |
21 | }, | 21 | }, |
22 | CompletionItem { | 22 | CompletionItem { |
23 | label: "match", | 23 | label: "match", |
24 | source_range: [83; 83), | 24 | source_range: [83; 83), |
25 | delete: [83; 83), | 25 | delete: [83; 83), |
26 | insert: "match $0 {}", | 26 | insert: "match $0 {}", |
27 | kind: Keyword | 27 | kind: Keyword, |
28 | }, | 28 | }, |
29 | CompletionItem { | 29 | CompletionItem { |
30 | label: "return", | 30 | label: "return", |
31 | source_range: [83; 83), | 31 | source_range: [83; 83), |
32 | delete: [83; 83), | 32 | delete: [83; 83), |
33 | insert: "return $0;", | 33 | insert: "return $0;", |
34 | kind: Keyword | 34 | kind: Keyword, |
35 | }, | 35 | }, |
36 | CompletionItem { | 36 | CompletionItem { |
37 | label: "while", | 37 | label: "while", |
38 | source_range: [83; 83), | 38 | source_range: [83; 83), |
39 | delete: [83; 83), | 39 | delete: [83; 83), |
40 | insert: "while $0 {}", | 40 | insert: "while $0 {}", |
41 | kind: Keyword | 41 | kind: Keyword, |
42 | } | 42 | }, |
43 | ] | 43 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi2.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi2.snap index d2093acdf..47beb904b 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi2.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi2.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.036383875Z" | 2 | created: "2019-05-23T22:44:10.871868390Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,34 +10,34 @@ expression: kind_completions | |||
10 | source_range: [83; 83), | 10 | source_range: [83; 83), |
11 | delete: [83; 83), | 11 | delete: [83; 83), |
12 | insert: "if $0 {}", | 12 | insert: "if $0 {}", |
13 | kind: Keyword | 13 | kind: Keyword, |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "loop", | 16 | label: "loop", |
17 | source_range: [83; 83), | 17 | source_range: [83; 83), |
18 | delete: [83; 83), | 18 | delete: [83; 83), |
19 | insert: "loop {$0}", | 19 | insert: "loop {$0}", |
20 | kind: Keyword | 20 | kind: Keyword, |
21 | }, | 21 | }, |
22 | CompletionItem { | 22 | CompletionItem { |
23 | label: "match", | 23 | label: "match", |
24 | source_range: [83; 83), | 24 | source_range: [83; 83), |
25 | delete: [83; 83), | 25 | delete: [83; 83), |
26 | insert: "match $0 {}", | 26 | insert: "match $0 {}", |
27 | kind: Keyword | 27 | kind: Keyword, |
28 | }, | 28 | }, |
29 | CompletionItem { | 29 | CompletionItem { |
30 | label: "return", | 30 | label: "return", |
31 | source_range: [83; 83), | 31 | source_range: [83; 83), |
32 | delete: [83; 83), | 32 | delete: [83; 83), |
33 | insert: "return $0;", | 33 | insert: "return $0;", |
34 | kind: Keyword | 34 | kind: Keyword, |
35 | }, | 35 | }, |
36 | CompletionItem { | 36 | CompletionItem { |
37 | label: "while", | 37 | label: "while", |
38 | source_range: [83; 83), | 38 | source_range: [83; 83), |
39 | delete: [83; 83), | 39 | delete: [83; 83), |
40 | insert: "while $0 {}", | 40 | insert: "while $0 {}", |
41 | kind: Keyword | 41 | kind: Keyword, |
42 | } | 42 | }, |
43 | ] | 43 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__mod_with_docs.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__mod_with_docs.snap index 1da3c3ba2..f2b26e393 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__mod_with_docs.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__mod_with_docs.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.066918191Z" | 2 | created: "2019-05-23T22:23:35.093689514Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -12,7 +12,7 @@ expression: kind_completions | |||
12 | insert: "my", | 12 | insert: "my", |
13 | kind: Module, | 13 | kind: Module, |
14 | documentation: Documentation( | 14 | documentation: Documentation( |
15 | "Some simple\ndocs describing `mod my`." | 15 | "Some simple\ndocs describing `mod my`.", |
16 | ) | 16 | ), |
17 | } | 17 | }, |
18 | ] | 18 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__module_items.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__module_items.snap index 86bc8679d..cee4898c3 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__module_items.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__module_items.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.161888678Z" | 2 | created: "2019-05-23T22:23:35.133106898Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,14 +10,14 @@ expression: kind_completions | |||
10 | source_range: [89; 89), | 10 | source_range: [89; 89), |
11 | delete: [89; 89), | 11 | delete: [89; 89), |
12 | insert: "Baz", | 12 | insert: "Baz", |
13 | kind: Enum | 13 | kind: Enum, |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "Foo", | 16 | label: "Foo", |
17 | source_range: [89; 89), | 17 | source_range: [89; 89), |
18 | delete: [89; 89), | 18 | delete: [89; 89), |
19 | insert: "Foo", | 19 | insert: "Foo", |
20 | kind: Struct | 20 | kind: Struct, |
21 | }, | 21 | }, |
22 | CompletionItem { | 22 | CompletionItem { |
23 | label: "quux", | 23 | label: "quux", |
@@ -25,6 +25,6 @@ expression: kind_completions | |||
25 | delete: [89; 89), | 25 | delete: [89; 89), |
26 | insert: "quux()$0", | 26 | insert: "quux()$0", |
27 | kind: Function, | 27 | kind: Function, |
28 | detail: "fn quux()" | 28 | detail: "fn quux()", |
29 | } | 29 | }, |
30 | ] | 30 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__module_items_in_nested_modules.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__module_items_in_nested_modules.snap index 9f796b7ca..ce18e5bb7 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__module_items_in_nested_modules.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__module_items_in_nested_modules.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.180517419Z" | 2 | created: "2019-05-23T22:23:35.134417551Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,7 +10,7 @@ expression: kind_completions | |||
10 | source_range: [101; 101), | 10 | source_range: [101; 101), |
11 | delete: [101; 101), | 11 | delete: [101; 101), |
12 | insert: "Bar", | 12 | insert: "Bar", |
13 | kind: Struct | 13 | kind: Struct, |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "quux", | 16 | label: "quux", |
@@ -18,6 +18,6 @@ expression: kind_completions | |||
18 | delete: [101; 101), | 18 | delete: [101; 101), |
19 | insert: "quux()$0", | 19 | insert: "quux()$0", |
20 | kind: Function, | 20 | kind: Function, |
21 | detail: "fn quux()" | 21 | detail: "fn quux()", |
22 | } | 22 | }, |
23 | ] | 23 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__nested_use_tree.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__nested_use_tree.snap index 4920e500e..4c143d28e 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__nested_use_tree.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__nested_use_tree.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.085605313Z" | 2 | created: "2019-05-23T22:23:35.099358768Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,13 +10,13 @@ expression: kind_completions | |||
10 | source_range: [12; 14), | 10 | source_range: [12; 14), |
11 | delete: [12; 14), | 11 | delete: [12; 14), |
12 | insert: "Spam", | 12 | insert: "Spam", |
13 | kind: Struct | 13 | kind: Struct, |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "foo", | 16 | label: "foo", |
17 | source_range: [12; 14), | 17 | source_range: [12; 14), |
18 | delete: [12; 14), | 18 | delete: [12; 14), |
19 | insert: "foo", | 19 | insert: "foo", |
20 | kind: Module | 20 | kind: Module, |
21 | } | 21 | }, |
22 | ] | 22 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__no_semi_after_break_continue_in_expr.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__no_semi_after_break_continue_in_expr.snap index 038e7f402..22e25fe3d 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__no_semi_after_break_continue_in_expr.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__no_semi_after_break_continue_in_expr.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:23.999953358Z" | 2 | created: "2019-05-23T22:23:35.085365816Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,48 +10,48 @@ expression: kind_completions | |||
10 | source_range: [106; 108), | 10 | source_range: [106; 108), |
11 | delete: [106; 108), | 11 | delete: [106; 108), |
12 | insert: "break", | 12 | insert: "break", |
13 | kind: Keyword | 13 | kind: Keyword, |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "continue", | 16 | label: "continue", |
17 | source_range: [106; 108), | 17 | source_range: [106; 108), |
18 | delete: [106; 108), | 18 | delete: [106; 108), |
19 | insert: "continue", | 19 | insert: "continue", |
20 | kind: Keyword | 20 | kind: Keyword, |
21 | }, | 21 | }, |
22 | CompletionItem { | 22 | CompletionItem { |
23 | label: "if", | 23 | label: "if", |
24 | source_range: [106; 108), | 24 | source_range: [106; 108), |
25 | delete: [106; 108), | 25 | delete: [106; 108), |
26 | insert: "if $0 {}", | 26 | insert: "if $0 {}", |
27 | kind: Keyword | 27 | kind: Keyword, |
28 | }, | 28 | }, |
29 | CompletionItem { | 29 | CompletionItem { |
30 | label: "loop", | 30 | label: "loop", |
31 | source_range: [106; 108), | 31 | source_range: [106; 108), |
32 | delete: [106; 108), | 32 | delete: [106; 108), |
33 | insert: "loop {$0}", | 33 | insert: "loop {$0}", |
34 | kind: Keyword | 34 | kind: Keyword, |
35 | }, | 35 | }, |
36 | CompletionItem { | 36 | CompletionItem { |
37 | label: "match", | 37 | label: "match", |
38 | source_range: [106; 108), | 38 | source_range: [106; 108), |
39 | delete: [106; 108), | 39 | delete: [106; 108), |
40 | insert: "match $0 {}", | 40 | insert: "match $0 {}", |
41 | kind: Keyword | 41 | kind: Keyword, |
42 | }, | 42 | }, |
43 | CompletionItem { | 43 | CompletionItem { |
44 | label: "return", | 44 | label: "return", |
45 | source_range: [106; 108), | 45 | source_range: [106; 108), |
46 | delete: [106; 108), | 46 | delete: [106; 108), |
47 | insert: "return", | 47 | insert: "return", |
48 | kind: Keyword | 48 | kind: Keyword, |
49 | }, | 49 | }, |
50 | CompletionItem { | 50 | CompletionItem { |
51 | label: "while", | 51 | label: "while", |
52 | source_range: [106; 108), | 52 | source_range: [106; 108), |
53 | delete: [106; 108), | 53 | delete: [106; 108), |
54 | insert: "while $0 {}", | 54 | insert: "while $0 {}", |
55 | kind: Keyword | 55 | kind: Keyword, |
56 | } | 56 | }, |
57 | ] | 57 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__postfix_completion_works_for_trivial_path_expression.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__postfix_completion_works_for_trivial_path_expression.snap index 3bbc9e3c4..fcb292596 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__postfix_completion_works_for_trivial_path_expression.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__postfix_completion_works_for_trivial_path_expression.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-04-22T07:37:13.981826301Z" | 2 | created: "2019-05-23T22:23:35.118738523Z" |
3 | creator: insta@0.7.4 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,48 +10,48 @@ expression: kind_completions | |||
10 | source_range: [76; 76), | 10 | source_range: [76; 76), |
11 | delete: [72; 76), | 11 | delete: [72; 76), |
12 | insert: "dbg!(bar)", | 12 | insert: "dbg!(bar)", |
13 | detail: "dbg!(expr)" | 13 | detail: "dbg!(expr)", |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "if", | 16 | label: "if", |
17 | source_range: [76; 76), | 17 | source_range: [76; 76), |
18 | delete: [72; 76), | 18 | delete: [72; 76), |
19 | insert: "if bar {$0}", | 19 | insert: "if bar {$0}", |
20 | detail: "if expr {}" | 20 | detail: "if expr {}", |
21 | }, | 21 | }, |
22 | CompletionItem { | 22 | CompletionItem { |
23 | label: "match", | 23 | label: "match", |
24 | source_range: [76; 76), | 24 | source_range: [76; 76), |
25 | delete: [72; 76), | 25 | delete: [72; 76), |
26 | insert: "match bar {\n ${1:_} => {$0\\},\n}", | 26 | insert: "match bar {\n ${1:_} => {$0\\},\n}", |
27 | detail: "match expr {}" | 27 | detail: "match expr {}", |
28 | }, | 28 | }, |
29 | CompletionItem { | 29 | CompletionItem { |
30 | label: "not", | 30 | label: "not", |
31 | source_range: [76; 76), | 31 | source_range: [76; 76), |
32 | delete: [72; 76), | 32 | delete: [72; 76), |
33 | insert: "!bar", | 33 | insert: "!bar", |
34 | detail: "!expr" | 34 | detail: "!expr", |
35 | }, | 35 | }, |
36 | CompletionItem { | 36 | CompletionItem { |
37 | label: "ref", | 37 | label: "ref", |
38 | source_range: [76; 76), | 38 | source_range: [76; 76), |
39 | delete: [72; 76), | 39 | delete: [72; 76), |
40 | insert: "&bar", | 40 | insert: "&bar", |
41 | detail: "&expr" | 41 | detail: "&expr", |
42 | }, | 42 | }, |
43 | CompletionItem { | 43 | CompletionItem { |
44 | label: "refm", | 44 | label: "refm", |
45 | source_range: [76; 76), | 45 | source_range: [76; 76), |
46 | delete: [72; 76), | 46 | delete: [72; 76), |
47 | insert: "&mut bar", | 47 | insert: "&mut bar", |
48 | detail: "&mut expr" | 48 | detail: "&mut expr", |
49 | }, | 49 | }, |
50 | CompletionItem { | 50 | CompletionItem { |
51 | label: "while", | 51 | label: "while", |
52 | source_range: [76; 76), | 52 | source_range: [76; 76), |
53 | delete: [72; 76), | 53 | delete: [72; 76), |
54 | insert: "while bar {\n$0\n}", | 54 | insert: "while bar {\n$0\n}", |
55 | detail: "while expr {}" | 55 | detail: "while expr {}", |
56 | } | 56 | }, |
57 | ] | 57 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__return_type.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__return_type.snap index ff36df707..16dd18431 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__return_type.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__return_type.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-04-04T14:52:24.525395600Z" | 2 | created: "2019-05-23T22:23:35.140648630Z" |
3 | creator: insta@0.7.4 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,7 +10,7 @@ expression: kind_completions | |||
10 | source_range: [47; 47), | 10 | source_range: [47; 47), |
11 | delete: [47; 47), | 11 | delete: [47; 47), |
12 | insert: "Foo", | 12 | insert: "Foo", |
13 | kind: Struct | 13 | kind: Struct, |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "x", | 16 | label: "x", |
@@ -18,6 +18,6 @@ expression: kind_completions | |||
18 | delete: [47; 47), | 18 | delete: [47; 47), |
19 | insert: "x()$0", | 19 | insert: "x()$0", |
20 | kind: Function, | 20 | kind: Function, |
21 | detail: "fn x()" | 21 | detail: "fn x()", |
22 | } | 22 | }, |
23 | ] | 23 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__self_in_methods.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__self_in_methods.snap index baf12cae1..e1af94870 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__self_in_methods.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__self_in_methods.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.174038680Z" | 2 | created: "2019-05-23T22:23:35.141900902Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,13 +10,13 @@ expression: kind_completions | |||
10 | source_range: [25; 25), | 10 | source_range: [25; 25), |
11 | delete: [25; 25), | 11 | delete: [25; 25), |
12 | insert: "Self", | 12 | insert: "Self", |
13 | kind: TypeParam | 13 | kind: TypeParam, |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "self", | 16 | label: "self", |
17 | source_range: [25; 25), | 17 | source_range: [25; 25), |
18 | delete: [25; 25), | 18 | delete: [25; 25), |
19 | insert: "self", | 19 | insert: "self", |
20 | kind: Binding | 20 | kind: Binding, |
21 | } | 21 | }, |
22 | ] | 22 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__snippets_in_expressions.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__snippets_in_expressions.snap index fce2d6479..6f41bf76f 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__snippets_in_expressions.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__snippets_in_expressions.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.191576723Z" | 2 | created: "2019-05-23T22:23:35.141901047Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,13 +10,13 @@ expression: kind_completions | |||
10 | source_range: [17; 17), | 10 | source_range: [17; 17), |
11 | delete: [17; 17), | 11 | delete: [17; 17), |
12 | insert: "eprintln!(\"$0 = {:?}\", $0);", | 12 | insert: "eprintln!(\"$0 = {:?}\", $0);", |
13 | kind: Snippet | 13 | kind: Snippet, |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "ppd", | 16 | label: "ppd", |
17 | source_range: [17; 17), | 17 | source_range: [17; 17), |
18 | delete: [17; 17), | 18 | delete: [17; 17), |
19 | insert: "eprintln!(\"$0 = {:#?}\", $0);", | 19 | insert: "eprintln!(\"$0 = {:#?}\", $0);", |
20 | kind: Snippet | 20 | kind: Snippet, |
21 | } | 21 | }, |
22 | ] | 22 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__snippets_in_items.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__snippets_in_items.snap index d2b1a5f0e..1eb0adebe 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__snippets_in_items.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__snippets_in_items.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.187670733Z" | 2 | created: "2019-05-23T22:23:35.149234118Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -11,13 +11,13 @@ expression: kind_completions | |||
11 | delete: [66; 66), | 11 | delete: [66; 66), |
12 | insert: "#[test]\nfn ${1:feature}() {\n $0\n}", | 12 | insert: "#[test]\nfn ${1:feature}() {\n $0\n}", |
13 | kind: Snippet, | 13 | kind: Snippet, |
14 | lookup: "tfn" | 14 | lookup: "tfn", |
15 | }, | 15 | }, |
16 | CompletionItem { | 16 | CompletionItem { |
17 | label: "pub(crate)", | 17 | label: "pub(crate)", |
18 | source_range: [66; 66), | 18 | source_range: [66; 66), |
19 | delete: [66; 66), | 19 | delete: [66; 66), |
20 | insert: "pub(crate) $0", | 20 | insert: "pub(crate) $0", |
21 | kind: Snippet | 21 | kind: Snippet, |
22 | } | 22 | }, |
23 | ] | 23 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__struct_associated_const.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__struct_associated_const.snap index 6ad4c5acc..f7bc6177c 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__struct_associated_const.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__struct_associated_const.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.093406123Z" | 2 | created: "2019-05-23T22:23:35.101474826Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -13,7 +13,7 @@ expression: kind_completions | |||
13 | kind: Const, | 13 | kind: Const, |
14 | detail: "const C: i32 = 42;", | 14 | detail: "const C: i32 = 42;", |
15 | documentation: Documentation( | 15 | documentation: Documentation( |
16 | "An associated const" | 16 | "An associated const", |
17 | ) | 17 | ), |
18 | } | 18 | }, |
19 | ] | 19 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__struct_associated_method.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__struct_associated_method.snap index 7c69eebeb..45080a802 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__struct_associated_method.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__struct_associated_method.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-24T16:33:47.990111169Z" | 2 | created: "2019-05-23T22:23:35.102351365Z" |
3 | creator: insta@0.6.3 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -13,7 +13,7 @@ expression: kind_completions | |||
13 | kind: Function, | 13 | kind: Function, |
14 | detail: "fn m()", | 14 | detail: "fn m()", |
15 | documentation: Documentation( | 15 | documentation: Documentation( |
16 | "An associated method" | 16 | "An associated method", |
17 | ) | 17 | ), |
18 | } | 18 | }, |
19 | ] | 19 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__struct_associated_type.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__struct_associated_type.snap index 583bda225..f40065286 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__struct_associated_type.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__struct_associated_type.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.090876030Z" | 2 | created: "2019-05-23T22:23:35.105188762Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -13,7 +13,7 @@ expression: kind_completions | |||
13 | kind: TypeAlias, | 13 | kind: TypeAlias, |
14 | detail: "type T = i32;", | 14 | detail: "type T = i32;", |
15 | documentation: Documentation( | 15 | documentation: Documentation( |
16 | "An associated type" | 16 | "An associated type", |
17 | ) | 17 | ), |
18 | } | 18 | }, |
19 | ] | 19 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__use_item_starting_with_crate.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__use_item_starting_with_crate.snap index 34e70c35d..17e831c84 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__use_item_starting_with_crate.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__use_item_starting_with_crate.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.098574884Z" | 2 | created: "2019-05-23T22:23:35.105336210Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,13 +10,13 @@ expression: kind_completions | |||
10 | source_range: [11; 13), | 10 | source_range: [11; 13), |
11 | delete: [11; 13), | 11 | delete: [11; 13), |
12 | insert: "Spam", | 12 | insert: "Spam", |
13 | kind: Struct | 13 | kind: Struct, |
14 | }, | 14 | }, |
15 | CompletionItem { | 15 | CompletionItem { |
16 | label: "foo", | 16 | label: "foo", |
17 | source_range: [11; 13), | 17 | source_range: [11; 13), |
18 | delete: [11; 13), | 18 | delete: [11; 13), |
19 | insert: "foo", | 19 | insert: "foo", |
20 | kind: Module | 20 | kind: Module, |
21 | } | 21 | }, |
22 | ] | 22 | ] |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__use_item_starting_with_self.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__use_item_starting_with_self.snap index d15f1905b..d1abc6b5b 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__use_item_starting_with_self.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__use_item_starting_with_self.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-18T09:22:24.102063333Z" | 2 | created: "2019-05-23T22:23:35.106923266Z" |
3 | creator: insta@0.6.2 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | 4 | source: crates/ra_ide_api/src/completion/completion_item.rs |
5 | expression: kind_completions | 5 | expression: kind_completions |
6 | --- | 6 | --- |
@@ -10,6 +10,6 @@ expression: kind_completions | |||
10 | source_range: [26; 26), | 10 | source_range: [26; 26), |
11 | delete: [26; 26), | 11 | delete: [26; 26), |
12 | insert: "Bar", | 12 | insert: "Bar", |
13 | kind: Struct | 13 | kind: Struct, |
14 | } | 14 | }, |
15 | ] | 15 | ] |
diff --git a/crates/ra_ide_api/src/diagnostics.rs b/crates/ra_ide_api/src/diagnostics.rs index 9a0eb2c14..923008708 100644 --- a/crates/ra_ide_api/src/diagnostics.rs +++ b/crates/ra_ide_api/src/diagnostics.rs | |||
@@ -310,28 +310,30 @@ mod tests { | |||
310 | fn test_unresolved_module_diagnostic() { | 310 | fn test_unresolved_module_diagnostic() { |
311 | let (analysis, file_id) = single_file("mod foo;"); | 311 | let (analysis, file_id) = single_file("mod foo;"); |
312 | let diagnostics = analysis.diagnostics(file_id).unwrap(); | 312 | let diagnostics = analysis.diagnostics(file_id).unwrap(); |
313 | assert_debug_snapshot_matches!(diagnostics, @r####"[ | 313 | assert_debug_snapshot_matches!(diagnostics, @r###" |
314 | Diagnostic { | 314 | ⋮[ |
315 | message: "unresolved module", | 315 | ⋮ Diagnostic { |
316 | range: [0; 8), | 316 | ⋮ message: "unresolved module", |
317 | fix: Some( | 317 | ⋮ range: [0; 8), |
318 | SourceChange { | 318 | ⋮ fix: Some( |
319 | label: "create module", | 319 | ⋮ SourceChange { |
320 | source_file_edits: [], | 320 | ⋮ label: "create module", |
321 | file_system_edits: [ | 321 | ⋮ source_file_edits: [], |
322 | CreateFile { | 322 | ⋮ file_system_edits: [ |
323 | source_root: SourceRootId( | 323 | ⋮ CreateFile { |
324 | 0 | 324 | ⋮ source_root: SourceRootId( |
325 | ), | 325 | ⋮ 0, |
326 | path: "foo.rs" | 326 | ⋮ ), |
327 | } | 327 | ⋮ path: "foo.rs", |
328 | ], | 328 | ⋮ }, |
329 | cursor_position: None | 329 | ⋮ ], |
330 | } | 330 | ⋮ cursor_position: None, |
331 | ), | 331 | ⋮ }, |
332 | severity: Error | 332 | ⋮ ), |
333 | } | 333 | ⋮ severity: Error, |
334 | ]"####); | 334 | ⋮ }, |
335 | ⋮] | ||
336 | "###); | ||
335 | } | 337 | } |
336 | 338 | ||
337 | #[test] | 339 | #[test] |
diff --git a/crates/ra_ide_api/src/display/navigation_target.rs b/crates/ra_ide_api/src/display/navigation_target.rs index 1c694cbc9..7f81483f7 100644 --- a/crates/ra_ide_api/src/display/navigation_target.rs +++ b/crates/ra_ide_api/src/display/navigation_target.rs | |||
@@ -154,6 +154,10 @@ impl NavigationTarget { | |||
154 | let (file_id, node) = s.source(db); | 154 | let (file_id, node) = s.source(db); |
155 | NavigationTarget::from_named(file_id.original_file(db), &*node) | 155 | NavigationTarget::from_named(file_id.original_file(db), &*node) |
156 | } | 156 | } |
157 | hir::AdtDef::Union(s) => { | ||
158 | let (file_id, node) = s.source(db); | ||
159 | NavigationTarget::from_named(file_id.original_file(db), &*node) | ||
160 | } | ||
157 | hir::AdtDef::Enum(s) => { | 161 | hir::AdtDef::Enum(s) => { |
158 | let (file_id, node) = s.source(db); | 162 | let (file_id, node) = s.source(db); |
159 | NavigationTarget::from_named(file_id.original_file(db), &*node) | 163 | NavigationTarget::from_named(file_id.original_file(db), &*node) |
@@ -169,6 +173,10 @@ impl NavigationTarget { | |||
169 | let (file_id, node) = s.source(db); | 173 | let (file_id, node) = s.source(db); |
170 | NavigationTarget::from_named(file_id.original_file(db), &*node) | 174 | NavigationTarget::from_named(file_id.original_file(db), &*node) |
171 | } | 175 | } |
176 | hir::ModuleDef::Union(s) => { | ||
177 | let (file_id, node) = s.source(db); | ||
178 | NavigationTarget::from_named(file_id.original_file(db), &*node) | ||
179 | } | ||
172 | hir::ModuleDef::Const(s) => { | 180 | hir::ModuleDef::Const(s) => { |
173 | let (file_id, node) = s.source(db); | 181 | let (file_id, node) = s.source(db); |
174 | NavigationTarget::from_named(file_id.original_file(db), &*node) | 182 | NavigationTarget::from_named(file_id.original_file(db), &*node) |
diff --git a/crates/ra_ide_api/src/display/snapshots/tests__file_structure.snap b/crates/ra_ide_api/src/display/snapshots/tests__file_structure.snap index 32dd99484..3097977de 100644 --- a/crates/ra_ide_api/src/display/snapshots/tests__file_structure.snap +++ b/crates/ra_ide_api/src/display/snapshots/tests__file_structure.snap | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-04-08T09:44:50.196004400Z" | 2 | created: "2019-05-23T22:23:35.168422050Z" |
3 | creator: insta@0.7.4 | 3 | creator: insta@0.8.1 |
4 | source: crates/ra_ide_api/src/display/structure.rs | 4 | source: crates/ra_ide_api/src/display/structure.rs |
5 | expression: structure | 5 | expression: structure |
6 | --- | 6 | --- |
@@ -12,20 +12,20 @@ expression: structure | |||
12 | node_range: [1; 26), | 12 | node_range: [1; 26), |
13 | kind: STRUCT_DEF, | 13 | kind: STRUCT_DEF, |
14 | detail: None, | 14 | detail: None, |
15 | deprecated: false | 15 | deprecated: false, |
16 | }, | 16 | }, |
17 | StructureNode { | 17 | StructureNode { |
18 | parent: Some( | 18 | parent: Some( |
19 | 0 | 19 | 0, |
20 | ), | 20 | ), |
21 | label: "x", | 21 | label: "x", |
22 | navigation_range: [18; 19), | 22 | navigation_range: [18; 19), |
23 | node_range: [18; 24), | 23 | node_range: [18; 24), |
24 | kind: NAMED_FIELD_DEF, | 24 | kind: NAMED_FIELD_DEF, |
25 | detail: Some( | 25 | detail: Some( |
26 | "i32" | 26 | "i32", |
27 | ), | 27 | ), |
28 | deprecated: false | 28 | deprecated: false, |
29 | }, | 29 | }, |
30 | StructureNode { | 30 | StructureNode { |
31 | parent: None, | 31 | parent: None, |
@@ -34,46 +34,46 @@ expression: structure | |||
34 | node_range: [28; 158), | 34 | node_range: [28; 158), |
35 | kind: MODULE, | 35 | kind: MODULE, |
36 | detail: None, | 36 | detail: None, |
37 | deprecated: false | 37 | deprecated: false, |
38 | }, | 38 | }, |
39 | StructureNode { | 39 | StructureNode { |
40 | parent: Some( | 40 | parent: Some( |
41 | 2 | 41 | 2, |
42 | ), | 42 | ), |
43 | label: "bar1", | 43 | label: "bar1", |
44 | navigation_range: [43; 47), | 44 | navigation_range: [43; 47), |
45 | node_range: [40; 52), | 45 | node_range: [40; 52), |
46 | kind: FN_DEF, | 46 | kind: FN_DEF, |
47 | detail: Some( | 47 | detail: Some( |
48 | "fn()" | 48 | "fn()", |
49 | ), | 49 | ), |
50 | deprecated: false | 50 | deprecated: false, |
51 | }, | 51 | }, |
52 | StructureNode { | 52 | StructureNode { |
53 | parent: Some( | 53 | parent: Some( |
54 | 2 | 54 | 2, |
55 | ), | 55 | ), |
56 | label: "bar2", | 56 | label: "bar2", |
57 | navigation_range: [60; 64), | 57 | navigation_range: [60; 64), |
58 | node_range: [57; 81), | 58 | node_range: [57; 81), |
59 | kind: FN_DEF, | 59 | kind: FN_DEF, |
60 | detail: Some( | 60 | detail: Some( |
61 | "fn<T>(t: T) -> T" | 61 | "fn<T>(t: T) -> T", |
62 | ), | 62 | ), |
63 | deprecated: false | 63 | deprecated: false, |
64 | }, | 64 | }, |
65 | StructureNode { | 65 | StructureNode { |
66 | parent: Some( | 66 | parent: Some( |
67 | 2 | 67 | 2, |
68 | ), | 68 | ), |
69 | label: "bar3", | 69 | label: "bar3", |
70 | navigation_range: [89; 93), | 70 | navigation_range: [89; 93), |
71 | node_range: [86; 156), | 71 | node_range: [86; 156), |
72 | kind: FN_DEF, | 72 | kind: FN_DEF, |
73 | detail: Some( | 73 | detail: Some( |
74 | "fn<A, B>(a: A, b: B) -> Vec< u32 >" | 74 | "fn<A, B>(a: A, b: B) -> Vec< u32 >", |
75 | ), | 75 | ), |
76 | deprecated: false | 76 | deprecated: false, |
77 | }, | 77 | }, |
78 | StructureNode { | 78 | StructureNode { |
79 | parent: None, | 79 | parent: None, |
@@ -82,29 +82,29 @@ expression: structure | |||
82 | node_range: [160; 180), | 82 | node_range: [160; 180), |
83 | kind: ENUM_DEF, | 83 | kind: ENUM_DEF, |
84 | detail: None, | 84 | detail: None, |
85 | deprecated: false | 85 | deprecated: false, |
86 | }, | 86 | }, |
87 | StructureNode { | 87 | StructureNode { |
88 | parent: Some( | 88 | parent: Some( |
89 | 6 | 89 | 6, |
90 | ), | 90 | ), |
91 | label: "X", | 91 | label: "X", |
92 | navigation_range: [169; 170), | 92 | navigation_range: [169; 170), |
93 | node_range: [169; 170), | 93 | node_range: [169; 170), |
94 | kind: ENUM_VARIANT, | 94 | kind: ENUM_VARIANT, |
95 | detail: None, | 95 | detail: None, |
96 | deprecated: false | 96 | deprecated: false, |
97 | }, | 97 | }, |
98 | StructureNode { | 98 | StructureNode { |
99 | parent: Some( | 99 | parent: Some( |
100 | 6 | 100 | 6, |
101 | ), | 101 | ), |
102 | label: "Y", | 102 | label: "Y", |
103 | navigation_range: [172; 173), | 103 | navigation_range: [172; 173), |
104 | node_range: [172; 178), | 104 | node_range: [172; 178), |
105 | kind: ENUM_VARIANT, | 105 | kind: ENUM_VARIANT, |
106 | detail: None, | 106 | detail: None, |
107 | deprecated: false | 107 | deprecated: false, |
108 | }, | 108 | }, |
109 | StructureNode { | 109 | StructureNode { |
110 | parent: None, | 110 | parent: None, |
@@ -113,9 +113,9 @@ expression: structure | |||
113 | node_range: [181; 193), | 113 | node_range: [181; 193), |
114 | kind: TYPE_ALIAS_DEF, | 114 | kind: TYPE_ALIAS_DEF, |
115 | detail: Some( | 115 | detail: Some( |
116 | "()" | 116 | "()", |
117 | ), | 117 | ), |
118 | deprecated: false | 118 | deprecated: false, |
119 | }, | 119 | }, |
120 | StructureNode { | 120 | StructureNode { |
121 | parent: None, | 121 | parent: None, |
@@ -124,9 +124,9 @@ expression: structure | |||
124 | node_range: [194; 213), | 124 | node_range: [194; 213), |
125 | kind: STATIC_DEF, | 125 | kind: STATIC_DEF, |
126 | detail: Some( | 126 | detail: Some( |
127 | "i32" | 127 | "i32", |
128 | ), | 128 | ), |
129 | deprecated: false | 129 | deprecated: false, |
130 | }, | 130 | }, |
131 | StructureNode { | 131 | StructureNode { |
132 | parent: None, | 132 | parent: None, |
@@ -135,9 +135,9 @@ expression: structure | |||
135 | node_range: [214; 232), | 135 | node_range: [214; 232), |
136 | kind: CONST_DEF, | 136 | kind: CONST_DEF, |
137 | detail: Some( | 137 | detail: Some( |
138 | "i32" | 138 | "i32", |
139 | ), | 139 | ), |
140 | deprecated: false | 140 | deprecated: false, |
141 | }, | 141 | }, |
142 | StructureNode { | 142 | StructureNode { |
143 | parent: None, | 143 | parent: None, |
@@ -146,7 +146,7 @@ expression: structure | |||
146 | node_range: [234; 243), | 146 | node_range: [234; 243), |
147 | kind: IMPL_BLOCK, | 147 | kind: IMPL_BLOCK, |
148 | detail: None, | 148 | detail: None, |
149 | deprecated: false | 149 | deprecated: false, |
150 | }, | 150 | }, |
151 | StructureNode { | 151 | StructureNode { |
152 | parent: None, | 152 | parent: None, |
@@ -155,7 +155,7 @@ expression: structure | |||
155 | node_range: [245; 269), | 155 | node_range: [245; 269), |
156 | kind: IMPL_BLOCK, | 156 | kind: IMPL_BLOCK, |
157 | detail: None, | 157 | detail: None, |
158 | deprecated: false | 158 | deprecated: false, |
159 | }, | 159 | }, |
160 | StructureNode { | 160 | StructureNode { |
161 | parent: None, | 161 | parent: None, |
@@ -164,9 +164,9 @@ expression: structure | |||
164 | node_range: [271; 301), | 164 | node_range: [271; 301), |
165 | kind: FN_DEF, | 165 | kind: FN_DEF, |
166 | detail: Some( | 166 | detail: Some( |
167 | "fn()" | 167 | "fn()", |
168 | ), | 168 | ), |
169 | deprecated: true | 169 | deprecated: true, |
170 | }, | 170 | }, |
171 | StructureNode { | 171 | StructureNode { |
172 | parent: None, | 172 | parent: None, |
@@ -175,8 +175,8 @@ expression: structure | |||
175 | node_range: [303; 359), | 175 | node_range: [303; 359), |
176 | kind: FN_DEF, | 176 | kind: FN_DEF, |
177 | detail: Some( | 177 | detail: Some( |
178 | "fn()" | 178 | "fn()", |
179 | ), | 179 | ), |
180 | deprecated: true | 180 | deprecated: true, |
181 | } | 181 | }, |
182 | ] | 182 | ] |
diff --git a/crates/ra_ide_api/src/lib.rs b/crates/ra_ide_api/src/lib.rs index f78348f74..d3456d5b2 100644 --- a/crates/ra_ide_api/src/lib.rs +++ b/crates/ra_ide_api/src/lib.rs | |||
@@ -462,6 +462,11 @@ impl Analysis { | |||
462 | self.with_db(|db| syntax_highlighting::highlight(db, file_id)) | 462 | self.with_db(|db| syntax_highlighting::highlight(db, file_id)) |
463 | } | 463 | } |
464 | 464 | ||
465 | /// Computes syntax highlighting for the given file. | ||
466 | pub fn highlight_as_html(&self, file_id: FileId) -> Cancelable<String> { | ||
467 | self.with_db(|db| syntax_highlighting::highlight_as_html(db, file_id)) | ||
468 | } | ||
469 | |||
465 | /// Computes completions at the given position. | 470 | /// Computes completions at the given position. |
466 | pub fn completions(&self, position: FilePosition) -> Cancelable<Option<Vec<CompletionItem>>> { | 471 | pub fn completions(&self, position: FilePosition) -> Cancelable<Option<Vec<CompletionItem>>> { |
467 | self.with_db(|db| completion::completions(db, position).map(Into::into)) | 472 | self.with_db(|db| completion::completions(db, position).map(Into::into)) |
diff --git a/crates/ra_ide_api/src/snapshots/highlighting.html b/crates/ra_ide_api/src/snapshots/highlighting.html new file mode 100644 index 000000000..bfc0a67b1 --- /dev/null +++ b/crates/ra_ide_api/src/snapshots/highlighting.html | |||
@@ -0,0 +1,45 @@ | |||
1 | |||
2 | <style> | ||
3 | pre { | ||
4 | color: #DCDCCC; | ||
5 | background-color: #3F3F3F; | ||
6 | font-size: 22px; | ||
7 | } | ||
8 | |||
9 | .comment { color: #7F9F7F; } | ||
10 | .string { color: #CC9393; } | ||
11 | .function { color: #93E0E3; } | ||
12 | .parameter { color: #94BFF3; } | ||
13 | .builtin { color: #DD6718; } | ||
14 | .text { color: #DCDCCC; } | ||
15 | .attribute { color: #BFEBBF; } | ||
16 | .literal { color: #DFAF8F; } | ||
17 | .macro { color: #DFAF8F; } | ||
18 | |||
19 | .keyword { color: #F0DFAF; } | ||
20 | .keyword\.unsafe { color: #F0DFAF; font-weight: bold; } | ||
21 | .keyword\.control { color: #DC8CC3; } | ||
22 | |||
23 | </style> | ||
24 | <pre><code> | ||
25 | <span class="attribute">#</span><span class="attribute">[</span><span class="attribute">derive</span><span class="attribute">(</span><span class="attribute">Clone</span><span class="attribute">,</span><span class="attribute"> </span><span class="attribute">Debug</span><span class="attribute">)</span><span class="attribute">]</span> | ||
26 | <span class="keyword">struct</span> <span class="function">Foo</span> { | ||
27 | <span class="keyword">pub</span> <span class="function">x</span>: <span class="text">i32</span>, | ||
28 | <span class="keyword">pub</span> <span class="function">y</span>: <span class="text">i32</span>, | ||
29 | } | ||
30 | |||
31 | <span class="keyword">fn</span> <span class="function">foo</span><<span class="type function">T</span>>() -> <span class="type">T</span> { | ||
32 | <span class="macro">unimplemented</span><span class="macro">!</span>(); | ||
33 | } | ||
34 | |||
35 | <span class="comment">// comment</span> | ||
36 | <span class="keyword">fn</span> <span class="function">main</span>() { | ||
37 | <span class="macro">println</span><span class="macro">!</span>(<span class="string">"Hello, {}!"</span>, <span class="literal">92</span>); | ||
38 | |||
39 | <span class="keyword">let</span> <span class="keyword">mut</span> <span class="function">vec</span> = <span class="text">Vec</span>::<span class="text">new</span>(); | ||
40 | <span class="keyword.control">if</span> <span class="keyword">true</span> { | ||
41 | <span class="text">vec</span>.<span class="text">push</span>(<span class="type">Foo</span> { <span class="field">x</span>: <span class="literal">0</span>, <span class="field">y</span>: <span class="literal">1</span> }); | ||
42 | } | ||
43 | <span class="keyword.unsafe">unsafe</span> { <span class="text">vec</span>.<span class="text">set_len</span>(<span class="literal">0</span>); } | ||
44 | } | ||
45 | </code></pre> \ No newline at end of file | ||
diff --git a/crates/ra_ide_api/src/snapshots/tests__highlighting.snap b/crates/ra_ide_api/src/snapshots/tests__highlighting.snap deleted file mode 100644 index 9d4c04db3..000000000 --- a/crates/ra_ide_api/src/snapshots/tests__highlighting.snap +++ /dev/null | |||
@@ -1,146 +0,0 @@ | |||
1 | --- | ||
2 | created: "2019-05-23T12:10:32.628883358Z" | ||
3 | creator: [email protected] | ||
4 | source: crates/ra_ide_api/src/syntax_highlighting.rs | ||
5 | expression: result | ||
6 | --- | ||
7 | Ok( | ||
8 | [ | ||
9 | HighlightedRange { | ||
10 | range: [1; 24), | ||
11 | tag: "attribute" | ||
12 | }, | ||
13 | HighlightedRange { | ||
14 | range: [25; 31), | ||
15 | tag: "keyword" | ||
16 | }, | ||
17 | HighlightedRange { | ||
18 | range: [32; 35), | ||
19 | tag: "function" | ||
20 | }, | ||
21 | HighlightedRange { | ||
22 | range: [42; 45), | ||
23 | tag: "keyword" | ||
24 | }, | ||
25 | HighlightedRange { | ||
26 | range: [46; 47), | ||
27 | tag: "function" | ||
28 | }, | ||
29 | HighlightedRange { | ||
30 | range: [49; 52), | ||
31 | tag: "text" | ||
32 | }, | ||
33 | HighlightedRange { | ||
34 | range: [58; 61), | ||
35 | tag: "keyword" | ||
36 | }, | ||
37 | HighlightedRange { | ||
38 | range: [62; 63), | ||
39 | tag: "function" | ||
40 | }, | ||
41 | HighlightedRange { | ||
42 | range: [65; 68), | ||
43 | tag: "text" | ||
44 | }, | ||
45 | HighlightedRange { | ||
46 | range: [73; 75), | ||
47 | tag: "keyword" | ||
48 | }, | ||
49 | HighlightedRange { | ||
50 | range: [76; 79), | ||
51 | tag: "function" | ||
52 | }, | ||
53 | HighlightedRange { | ||
54 | range: [80; 81), | ||
55 | tag: "type" | ||
56 | }, | ||
57 | HighlightedRange { | ||
58 | range: [80; 81), | ||
59 | tag: "function" | ||
60 | }, | ||
61 | HighlightedRange { | ||
62 | range: [88; 89), | ||
63 | tag: "type" | ||
64 | }, | ||
65 | HighlightedRange { | ||
66 | range: [96; 110), | ||
67 | tag: "macro" | ||
68 | }, | ||
69 | HighlightedRange { | ||
70 | range: [117; 127), | ||
71 | tag: "comment" | ||
72 | }, | ||
73 | HighlightedRange { | ||
74 | range: [128; 130), | ||
75 | tag: "keyword" | ||
76 | }, | ||
77 | HighlightedRange { | ||
78 | range: [131; 135), | ||
79 | tag: "function" | ||
80 | }, | ||
81 | HighlightedRange { | ||
82 | range: [145; 153), | ||
83 | tag: "macro" | ||
84 | }, | ||
85 | HighlightedRange { | ||
86 | range: [154; 166), | ||
87 | tag: "string" | ||
88 | }, | ||
89 | HighlightedRange { | ||
90 | range: [168; 170), | ||
91 | tag: "literal" | ||
92 | }, | ||
93 | HighlightedRange { | ||
94 | range: [178; 181), | ||
95 | tag: "keyword" | ||
96 | }, | ||
97 | HighlightedRange { | ||
98 | range: [182; 185), | ||
99 | tag: "keyword" | ||
100 | }, | ||
101 | HighlightedRange { | ||
102 | range: [186; 189), | ||
103 | tag: "macro" | ||
104 | }, | ||
105 | HighlightedRange { | ||
106 | range: [197; 200), | ||
107 | tag: "macro" | ||
108 | }, | ||
109 | HighlightedRange { | ||
110 | range: [192; 195), | ||
111 | tag: "text" | ||
112 | }, | ||
113 | HighlightedRange { | ||
114 | range: [208; 211), | ||
115 | tag: "macro" | ||
116 | }, | ||
117 | HighlightedRange { | ||
118 | range: [212; 216), | ||
119 | tag: "macro" | ||
120 | }, | ||
121 | HighlightedRange { | ||
122 | range: [226; 227), | ||
123 | tag: "literal" | ||
124 | }, | ||
125 | HighlightedRange { | ||
126 | range: [232; 233), | ||
127 | tag: "literal" | ||
128 | }, | ||
129 | HighlightedRange { | ||
130 | range: [242; 248), | ||
131 | tag: "keyword.unsafe" | ||
132 | }, | ||
133 | HighlightedRange { | ||
134 | range: [251; 254), | ||
135 | tag: "text" | ||
136 | }, | ||
137 | HighlightedRange { | ||
138 | range: [255; 262), | ||
139 | tag: "text" | ||
140 | }, | ||
141 | HighlightedRange { | ||
142 | range: [263; 264), | ||
143 | tag: "literal" | ||
144 | } | ||
145 | ] | ||
146 | ) | ||
diff --git a/crates/ra_ide_api/src/snapshots/tests__rename_mod.snap b/crates/ra_ide_api/src/snapshots/tests__rename_mod.snap index 890426db7..431de5c55 100644 --- a/crates/ra_ide_api/src/snapshots/tests__rename_mod.snap +++ b/crates/ra_ide_api/src/snapshots/tests__rename_mod.snap | |||
@@ -1,8 +1,8 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-01-24T08:39:53.759318522+00:00" | 2 | created: "2019-05-23T22:23:35.215905447Z" |
3 | creator: [email protected] | 3 | creator: [email protected] |
4 | source: crates/ra_ide_api/src/references.rs | ||
4 | expression: "&source_change" | 5 | expression: "&source_change" |
5 | source: crates/ra_ide_api/src/rename.rs | ||
6 | --- | 6 | --- |
7 | Some( | 7 | Some( |
8 | SourceChange { | 8 | SourceChange { |
@@ -10,29 +10,29 @@ Some( | |||
10 | source_file_edits: [ | 10 | source_file_edits: [ |
11 | SourceFileEdit { | 11 | SourceFileEdit { |
12 | file_id: FileId( | 12 | file_id: FileId( |
13 | 2 | 13 | 2, |
14 | ), | 14 | ), |
15 | edit: TextEdit { | 15 | edit: TextEdit { |
16 | atoms: [ | 16 | atoms: [ |
17 | AtomTextEdit { | 17 | AtomTextEdit { |
18 | delete: [4; 7), | 18 | delete: [4; 7), |
19 | insert: "foo2" | 19 | insert: "foo2", |
20 | } | 20 | }, |
21 | ] | 21 | ], |
22 | } | 22 | }, |
23 | } | 23 | }, |
24 | ], | 24 | ], |
25 | file_system_edits: [ | 25 | file_system_edits: [ |
26 | MoveFile { | 26 | MoveFile { |
27 | src: FileId( | 27 | src: FileId( |
28 | 3 | 28 | 3, |
29 | ), | 29 | ), |
30 | dst_source_root: SourceRootId( | 30 | dst_source_root: SourceRootId( |
31 | 0 | 31 | 0, |
32 | ), | 32 | ), |
33 | dst_path: "bar/foo2.rs" | 33 | dst_path: "bar/foo2.rs", |
34 | } | 34 | }, |
35 | ], | 35 | ], |
36 | cursor_position: None | 36 | cursor_position: None, |
37 | } | 37 | }, |
38 | ) | 38 | ) |
diff --git a/crates/ra_ide_api/src/snapshots/tests__rename_mod_in_dir.snap b/crates/ra_ide_api/src/snapshots/tests__rename_mod_in_dir.snap index e96bf5c02..aaff9b4b5 100644 --- a/crates/ra_ide_api/src/snapshots/tests__rename_mod_in_dir.snap +++ b/crates/ra_ide_api/src/snapshots/tests__rename_mod_in_dir.snap | |||
@@ -1,8 +1,8 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-01-22T14:45:00.975229300+00:00" | 2 | created: "2019-05-23T22:23:35.213830371Z" |
3 | creator: [email protected] | 3 | creator: [email protected] |
4 | source: crates/ra_ide_api/src/references.rs | ||
4 | expression: "&source_change" | 5 | expression: "&source_change" |
5 | source: "crates\\ra_ide_api\\src\\rename.rs" | ||
6 | --- | 6 | --- |
7 | Some( | 7 | Some( |
8 | SourceChange { | 8 | SourceChange { |
@@ -10,29 +10,29 @@ Some( | |||
10 | source_file_edits: [ | 10 | source_file_edits: [ |
11 | SourceFileEdit { | 11 | SourceFileEdit { |
12 | file_id: FileId( | 12 | file_id: FileId( |
13 | 1 | 13 | 1, |
14 | ), | 14 | ), |
15 | edit: TextEdit { | 15 | edit: TextEdit { |
16 | atoms: [ | 16 | atoms: [ |
17 | AtomTextEdit { | 17 | AtomTextEdit { |
18 | delete: [4; 7), | 18 | delete: [4; 7), |
19 | insert: "foo2" | 19 | insert: "foo2", |
20 | } | 20 | }, |
21 | ] | 21 | ], |
22 | } | 22 | }, |
23 | } | 23 | }, |
24 | ], | 24 | ], |
25 | file_system_edits: [ | 25 | file_system_edits: [ |
26 | MoveFile { | 26 | MoveFile { |
27 | src: FileId( | 27 | src: FileId( |
28 | 2 | 28 | 2, |
29 | ), | 29 | ), |
30 | dst_source_root: SourceRootId( | 30 | dst_source_root: SourceRootId( |
31 | 0 | 31 | 0, |
32 | ), | 32 | ), |
33 | dst_path: "foo2/mod.rs" | 33 | dst_path: "foo2/mod.rs", |
34 | } | 34 | }, |
35 | ], | 35 | ], |
36 | cursor_position: None | 36 | cursor_position: None, |
37 | } | 37 | }, |
38 | ) | 38 | ) |
diff --git a/crates/ra_ide_api/src/snapshots/tests__runnables.snap b/crates/ra_ide_api/src/snapshots/tests__runnables.snap index 71bd7a4bd..de2fadd7f 100644 --- a/crates/ra_ide_api/src/snapshots/tests__runnables.snap +++ b/crates/ra_ide_api/src/snapshots/tests__runnables.snap | |||
@@ -1,24 +1,24 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-01-22T14:45:00.975229300+00:00" | 2 | created: "2019-05-23T22:23:35.217100106Z" |
3 | creator: [email protected] | 3 | creator: [email protected] |
4 | source: crates/ra_ide_api/src/runnables.rs | ||
4 | expression: "&runnables" | 5 | expression: "&runnables" |
5 | source: "crates\\ra_ide_api\\src\\runnables.rs" | ||
6 | --- | 6 | --- |
7 | [ | 7 | [ |
8 | Runnable { | 8 | Runnable { |
9 | range: [1; 21), | 9 | range: [1; 21), |
10 | kind: Bin | 10 | kind: Bin, |
11 | }, | 11 | }, |
12 | Runnable { | 12 | Runnable { |
13 | range: [22; 46), | 13 | range: [22; 46), |
14 | kind: Test { | 14 | kind: Test { |
15 | name: "test_foo" | 15 | name: "test_foo", |
16 | } | 16 | }, |
17 | }, | 17 | }, |
18 | Runnable { | 18 | Runnable { |
19 | range: [47; 81), | 19 | range: [47; 81), |
20 | kind: Test { | 20 | kind: Test { |
21 | name: "test_foo" | 21 | name: "test_foo", |
22 | } | 22 | }, |
23 | } | 23 | }, |
24 | ] | 24 | ] |
diff --git a/crates/ra_ide_api/src/snapshots/tests__runnables_module.snap b/crates/ra_ide_api/src/snapshots/tests__runnables_module.snap index a28dd8952..23993a97f 100644 --- a/crates/ra_ide_api/src/snapshots/tests__runnables_module.snap +++ b/crates/ra_ide_api/src/snapshots/tests__runnables_module.snap | |||
@@ -1,20 +1,20 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-01-22T14:45:00.976230700+00:00" | 2 | created: "2019-05-23T22:23:35.219258850Z" |
3 | creator: [email protected] | 3 | creator: [email protected] |
4 | source: crates/ra_ide_api/src/runnables.rs | ||
4 | expression: "&runnables" | 5 | expression: "&runnables" |
5 | source: "crates\\ra_ide_api\\src\\runnables.rs" | ||
6 | --- | 6 | --- |
7 | [ | 7 | [ |
8 | Runnable { | 8 | Runnable { |
9 | range: [1; 59), | 9 | range: [1; 59), |
10 | kind: TestMod { | 10 | kind: TestMod { |
11 | path: "test_mod" | 11 | path: "test_mod", |
12 | } | 12 | }, |
13 | }, | 13 | }, |
14 | Runnable { | 14 | Runnable { |
15 | range: [28; 57), | 15 | range: [28; 57), |
16 | kind: Test { | 16 | kind: Test { |
17 | name: "test_foo1" | 17 | name: "test_foo1", |
18 | } | 18 | }, |
19 | } | 19 | }, |
20 | ] | 20 | ] |
diff --git a/crates/ra_ide_api/src/snapshots/tests__runnables_multiple_depth_module.snap b/crates/ra_ide_api/src/snapshots/tests__runnables_multiple_depth_module.snap index 79f07bef9..c516a61df 100644 --- a/crates/ra_ide_api/src/snapshots/tests__runnables_multiple_depth_module.snap +++ b/crates/ra_ide_api/src/snapshots/tests__runnables_multiple_depth_module.snap | |||
@@ -1,20 +1,20 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-01-22T14:45:00.979218100+00:00" | 2 | created: "2019-05-23T22:23:35.219671663Z" |
3 | creator: [email protected] | 3 | creator: [email protected] |
4 | source: crates/ra_ide_api/src/runnables.rs | ||
4 | expression: "&runnables" | 5 | expression: "&runnables" |
5 | source: "crates\\ra_ide_api\\src\\runnables.rs" | ||
6 | --- | 6 | --- |
7 | [ | 7 | [ |
8 | Runnable { | 8 | Runnable { |
9 | range: [41; 115), | 9 | range: [41; 115), |
10 | kind: TestMod { | 10 | kind: TestMod { |
11 | path: "foo::bar::test_mod" | 11 | path: "foo::bar::test_mod", |
12 | } | 12 | }, |
13 | }, | 13 | }, |
14 | Runnable { | 14 | Runnable { |
15 | range: [68; 105), | 15 | range: [68; 105), |
16 | kind: Test { | 16 | kind: Test { |
17 | name: "test_foo1" | 17 | name: "test_foo1", |
18 | } | 18 | }, |
19 | } | 19 | }, |
20 | ] | 20 | ] |
diff --git a/crates/ra_ide_api/src/snapshots/tests__runnables_one_depth_layer_module.snap b/crates/ra_ide_api/src/snapshots/tests__runnables_one_depth_layer_module.snap index d199e9073..b02e6707e 100644 --- a/crates/ra_ide_api/src/snapshots/tests__runnables_one_depth_layer_module.snap +++ b/crates/ra_ide_api/src/snapshots/tests__runnables_one_depth_layer_module.snap | |||
@@ -1,20 +1,20 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-01-22T14:45:01.016119500+00:00" | 2 | created: "2019-05-23T22:23:35.224315047Z" |
3 | creator: [email protected] | 3 | creator: [email protected] |
4 | source: crates/ra_ide_api/src/runnables.rs | ||
4 | expression: "&runnables" | 5 | expression: "&runnables" |
5 | source: "crates\\ra_ide_api\\src\\runnables.rs" | ||
6 | --- | 6 | --- |
7 | [ | 7 | [ |
8 | Runnable { | 8 | Runnable { |
9 | range: [23; 85), | 9 | range: [23; 85), |
10 | kind: TestMod { | 10 | kind: TestMod { |
11 | path: "foo::test_mod" | 11 | path: "foo::test_mod", |
12 | } | 12 | }, |
13 | }, | 13 | }, |
14 | Runnable { | 14 | Runnable { |
15 | range: [46; 79), | 15 | range: [46; 79), |
16 | kind: Test { | 16 | kind: Test { |
17 | name: "test_foo1" | 17 | name: "test_foo1", |
18 | } | 18 | }, |
19 | } | 19 | }, |
20 | ] | 20 | ] |
diff --git a/crates/ra_ide_api/src/syntax_highlighting.rs b/crates/ra_ide_api/src/syntax_highlighting.rs index 89f20260f..87e053364 100644 --- a/crates/ra_ide_api/src/syntax_highlighting.rs +++ b/crates/ra_ide_api/src/syntax_highlighting.rs | |||
@@ -2,6 +2,7 @@ use rustc_hash::FxHashSet; | |||
2 | 2 | ||
3 | use ra_syntax::{ast, AstNode, TextRange, Direction, SyntaxKind, SyntaxKind::*, SyntaxElement, T}; | 3 | use ra_syntax::{ast, AstNode, TextRange, Direction, SyntaxKind, SyntaxKind::*, SyntaxElement, T}; |
4 | use ra_db::SourceDatabase; | 4 | use ra_db::SourceDatabase; |
5 | use ra_prof::profile; | ||
5 | 6 | ||
6 | use crate::{FileId, db::RootDatabase}; | 7 | use crate::{FileId, db::RootDatabase}; |
7 | 8 | ||
@@ -27,6 +28,8 @@ fn is_control_keyword(kind: SyntaxKind) -> bool { | |||
27 | } | 28 | } |
28 | 29 | ||
29 | pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Vec<HighlightedRange> { | 30 | pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Vec<HighlightedRange> { |
31 | let _p = profile("highlight"); | ||
32 | |||
30 | let source_file = db.parse(file_id); | 33 | let source_file = db.parse(file_id); |
31 | 34 | ||
32 | // Visited nodes to handle highlighting priorities | 35 | // Visited nodes to handle highlighting priorities |
@@ -57,6 +60,7 @@ pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Vec<HighlightedRa | |||
57 | Some(Def(ModuleDef::Module(_))) => "module", | 60 | Some(Def(ModuleDef::Module(_))) => "module", |
58 | Some(Def(ModuleDef::Function(_))) => "function", | 61 | Some(Def(ModuleDef::Function(_))) => "function", |
59 | Some(Def(ModuleDef::Struct(_))) => "type", | 62 | Some(Def(ModuleDef::Struct(_))) => "type", |
63 | Some(Def(ModuleDef::Union(_))) => "type", | ||
60 | Some(Def(ModuleDef::Enum(_))) => "type", | 64 | Some(Def(ModuleDef::Enum(_))) => "type", |
61 | Some(Def(ModuleDef::EnumVariant(_))) => "constant", | 65 | Some(Def(ModuleDef::EnumVariant(_))) => "constant", |
62 | Some(Def(ModuleDef::Const(_))) => "constant", | 66 | Some(Def(ModuleDef::Const(_))) => "constant", |
@@ -110,10 +114,79 @@ pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Vec<HighlightedRa | |||
110 | res | 114 | res |
111 | } | 115 | } |
112 | 116 | ||
117 | pub(crate) fn highlight_as_html(db: &RootDatabase, file_id: FileId) -> String { | ||
118 | let source_file = db.parse(file_id); | ||
119 | |||
120 | let mut ranges = highlight(db, file_id); | ||
121 | ranges.sort_by_key(|it| it.range.start()); | ||
122 | // quick non-optimal heuristic to intersect token ranges and highlighted ranges | ||
123 | let mut frontier = 0; | ||
124 | let mut could_intersect: Vec<&HighlightedRange> = Vec::new(); | ||
125 | |||
126 | let mut buf = String::new(); | ||
127 | buf.push_str(&STYLE); | ||
128 | buf.push_str("<pre><code>"); | ||
129 | let tokens = source_file.syntax().descendants_with_tokens().filter_map(|it| it.as_token()); | ||
130 | for token in tokens { | ||
131 | could_intersect.retain(|it| token.range().start() <= it.range.end()); | ||
132 | while let Some(r) = ranges.get(frontier) { | ||
133 | if r.range.start() <= token.range().end() { | ||
134 | could_intersect.push(r); | ||
135 | frontier += 1; | ||
136 | } else { | ||
137 | break; | ||
138 | } | ||
139 | } | ||
140 | let text = html_escape(&token.text()); | ||
141 | let classes = could_intersect | ||
142 | .iter() | ||
143 | .filter(|it| token.range().is_subrange(&it.range)) | ||
144 | .map(|it| it.tag) | ||
145 | .collect::<Vec<_>>(); | ||
146 | if classes.is_empty() { | ||
147 | buf.push_str(&text); | ||
148 | } else { | ||
149 | let classes = classes.join(" "); | ||
150 | buf.push_str(&format!("<span class=\"{}\">{}</span>", classes, text)); | ||
151 | } | ||
152 | } | ||
153 | buf.push_str("</code></pre>"); | ||
154 | buf | ||
155 | } | ||
156 | |||
157 | //FIXME: like, real html escaping | ||
158 | fn html_escape(text: &str) -> String { | ||
159 | text.replace("<", "<").replace(">", ">") | ||
160 | } | ||
161 | |||
162 | const STYLE: &str = " | ||
163 | <style> | ||
164 | pre { | ||
165 | color: #DCDCCC; | ||
166 | background-color: #3F3F3F; | ||
167 | font-size: 22px; | ||
168 | } | ||
169 | |||
170 | .comment { color: #7F9F7F; } | ||
171 | .string { color: #CC9393; } | ||
172 | .function { color: #93E0E3; } | ||
173 | .parameter { color: #94BFF3; } | ||
174 | .builtin { color: #DD6718; } | ||
175 | .text { color: #DCDCCC; } | ||
176 | .attribute { color: #BFEBBF; } | ||
177 | .literal { color: #DFAF8F; } | ||
178 | .macro { color: #DFAF8F; } | ||
179 | |||
180 | .keyword { color: #F0DFAF; } | ||
181 | .keyword\\.unsafe { color: #F0DFAF; font-weight: bold; } | ||
182 | .keyword\\.control { color: #DC8CC3; } | ||
183 | |||
184 | </style> | ||
185 | "; | ||
186 | |||
113 | #[cfg(test)] | 187 | #[cfg(test)] |
114 | mod tests { | 188 | mod tests { |
115 | use insta::assert_debug_snapshot_matches; | 189 | use test_utils::{project_dir, read_text, assert_eq_text}; |
116 | |||
117 | use crate::mock_analysis::single_file; | 190 | use crate::mock_analysis::single_file; |
118 | 191 | ||
119 | #[test] | 192 | #[test] |
@@ -131,15 +204,21 @@ fn foo<T>() -> T { | |||
131 | } | 204 | } |
132 | 205 | ||
133 | // comment | 206 | // comment |
134 | fn main() {} | 207 | fn main() { |
135 | println!("Hello, {}!", 92); | 208 | println!("Hello, {}!", 92); |
136 | 209 | ||
137 | let mut vec = Vec::new(); | 210 | let mut vec = Vec::new(); |
138 | vec.push(Foo { x: 0, y: 1 }); | 211 | if true { |
212 | vec.push(Foo { x: 0, y: 1 }); | ||
213 | } | ||
139 | unsafe { vec.set_len(0); } | 214 | unsafe { vec.set_len(0); } |
215 | } | ||
140 | "#, | 216 | "#, |
141 | ); | 217 | ); |
142 | let result = analysis.highlight(file_id); | 218 | let dst_file = project_dir().join("crates/ra_ide_api/src/snapshots/highlighting.html"); |
143 | assert_debug_snapshot_matches!("highlighting", result); | 219 | let actual_html = &analysis.highlight_as_html(file_id).unwrap(); |
220 | let expected_html = &read_text(&dst_file); | ||
221 | // std::fs::write(dst_file, &actual_html).unwrap(); | ||
222 | assert_eq_text!(expected_html, actual_html); | ||
144 | } | 223 | } |
145 | } | 224 | } |