aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/completion
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/completion')
-rw-r--r--crates/ra_ide_api/src/completion/complete_keyword.rs679
-rw-r--r--crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops1.snap57
-rw-r--r--crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops2.snap43
-rw-r--r--crates/ra_ide_api/src/completion/snapshots/completion_item__dont_add_semi_after_return_if_not_a_statement.snap43
-rw-r--r--crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function1.snap43
-rw-r--r--crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function2.snap57
-rw-r--r--crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function3.snap43
-rw-r--r--crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function4.snap43
-rw-r--r--crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt1.snap29
-rw-r--r--crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt2.snap22
-rw-r--r--crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt3.snap22
-rw-r--r--crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi1.snap43
-rw-r--r--crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi2.snap43
-rw-r--r--crates/ra_ide_api/src/completion/snapshots/completion_item__no_semi_after_break_continue_in_expr.snap57
14 files changed, 580 insertions, 644 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_keyword.rs b/crates/ra_ide_api/src/completion/complete_keyword.rs
index 718b83418..cfb9fd6e8 100644
--- a/crates/ra_ide_api/src/completion/complete_keyword.rs
+++ b/crates/ra_ide_api/src/completion/complete_keyword.rs
@@ -109,159 +109,640 @@ fn complete_return(
109 109
110#[cfg(test)] 110#[cfg(test)]
111mod tests { 111mod tests {
112 use crate::completion::{check_completion, CompletionKind}; 112 use crate::completion::{do_completion, CompletionItem, CompletionKind};
113 use insta::assert_debug_snapshot_matches;
113 114
114 fn check_keyword_completion(name: &str, code: &str) { 115 fn do_keyword_completion(code: &str) -> Vec<CompletionItem> {
115 check_completion(name, code, CompletionKind::Keyword); 116 do_completion(code, CompletionKind::Keyword)
116 } 117 }
117 118
118 #[test] 119 #[test]
119 fn completes_keywords_in_use_stmt() { 120 fn completes_keywords_in_use_stmt() {
120 check_keyword_completion( 121 assert_debug_snapshot_matches!(
121 "keywords_in_use_stmt1", 122 do_keyword_completion(
122 r" 123 r"
123 use <|> 124 use <|>
124 ", 125 ",
126 ),
127 @r###"[
128 CompletionItem {
129 label: "crate",
130 source_range: [21; 21),
131 delete: [21; 21),
132 insert: "crate::",
133 kind: Keyword,
134 },
135 CompletionItem {
136 label: "self",
137 source_range: [21; 21),
138 delete: [21; 21),
139 insert: "self",
140 kind: Keyword,
141 },
142 CompletionItem {
143 label: "super",
144 source_range: [21; 21),
145 delete: [21; 21),
146 insert: "super::",
147 kind: Keyword,
148 },
149]"###
125 ); 150 );
126 151
127 check_keyword_completion( 152 assert_debug_snapshot_matches!(
128 "keywords_in_use_stmt2", 153 do_keyword_completion(
129 r" 154 r"
130 use a::<|> 155 use a::<|>
131 ", 156 ",
157 ),
158 @r###"[
159 CompletionItem {
160 label: "self",
161 source_range: [24; 24),
162 delete: [24; 24),
163 insert: "self",
164 kind: Keyword,
165 },
166 CompletionItem {
167 label: "super",
168 source_range: [24; 24),
169 delete: [24; 24),
170 insert: "super::",
171 kind: Keyword,
172 },
173]"###
132 ); 174 );
133 175
134 check_keyword_completion( 176 assert_debug_snapshot_matches!(
135 "keywords_in_use_stmt3", 177 do_keyword_completion(
136 r" 178 r"
137 use a::{b, <|>} 179 use a::{b, <|>}
138 ", 180 ",
181 ),
182 @r###"[
183 CompletionItem {
184 label: "self",
185 source_range: [28; 28),
186 delete: [28; 28),
187 insert: "self",
188 kind: Keyword,
189 },
190 CompletionItem {
191 label: "super",
192 source_range: [28; 28),
193 delete: [28; 28),
194 insert: "super::",
195 kind: Keyword,
196 },
197]"###
139 ); 198 );
140 } 199 }
141 200
142 #[test] 201 #[test]
143 fn completes_various_keywords_in_function() { 202 fn completes_various_keywords_in_function() {
144 check_keyword_completion( 203 assert_debug_snapshot_matches!(
145 "keywords_in_function1", 204 do_keyword_completion(
146 r" 205 r"
147 fn quux() { 206 fn quux() {
148 <|> 207 <|>
149 } 208 }
150 ", 209 ",
210 ),
211 @r###"[
212 CompletionItem {
213 label: "if",
214 source_range: [49; 49),
215 delete: [49; 49),
216 insert: "if $0 {}",
217 kind: Keyword,
218 },
219 CompletionItem {
220 label: "loop",
221 source_range: [49; 49),
222 delete: [49; 49),
223 insert: "loop {$0}",
224 kind: Keyword,
225 },
226 CompletionItem {
227 label: "match",
228 source_range: [49; 49),
229 delete: [49; 49),
230 insert: "match $0 {}",
231 kind: Keyword,
232 },
233 CompletionItem {
234 label: "return",
235 source_range: [49; 49),
236 delete: [49; 49),
237 insert: "return;",
238 kind: Keyword,
239 },
240 CompletionItem {
241 label: "while",
242 source_range: [49; 49),
243 delete: [49; 49),
244 insert: "while $0 {}",
245 kind: Keyword,
246 },
247]"###
151 ); 248 );
152 } 249 }
153 250
154 #[test] 251 #[test]
155 fn completes_else_after_if() { 252 fn completes_else_after_if() {
156 check_keyword_completion( 253 assert_debug_snapshot_matches!(
157 "keywords_in_function2", 254 do_keyword_completion(
158 r" 255 r"
159 fn quux() { 256 fn quux() {
160 if true { 257 if true {
161 () 258 ()
162 } <|> 259 } <|>
163 } 260 }
164 ", 261 ",
262 ),
263 @r###"[
264 CompletionItem {
265 label: "else",
266 source_range: [108; 108),
267 delete: [108; 108),
268 insert: "else {$0}",
269 kind: Keyword,
270 },
271 CompletionItem {
272 label: "else if",
273 source_range: [108; 108),
274 delete: [108; 108),
275 insert: "else if $0 {}",
276 kind: Keyword,
277 },
278 CompletionItem {
279 label: "if",
280 source_range: [108; 108),
281 delete: [108; 108),
282 insert: "if $0 {}",
283 kind: Keyword,
284 },
285 CompletionItem {
286 label: "loop",
287 source_range: [108; 108),
288 delete: [108; 108),
289 insert: "loop {$0}",
290 kind: Keyword,
291 },
292 CompletionItem {
293 label: "match",
294 source_range: [108; 108),
295 delete: [108; 108),
296 insert: "match $0 {}",
297 kind: Keyword,
298 },
299 CompletionItem {
300 label: "return",
301 source_range: [108; 108),
302 delete: [108; 108),
303 insert: "return;",
304 kind: Keyword,
305 },
306 CompletionItem {
307 label: "while",
308 source_range: [108; 108),
309 delete: [108; 108),
310 insert: "while $0 {}",
311 kind: Keyword,
312 },
313]"###
165 ); 314 );
166 } 315 }
167 316
168 #[test] 317 #[test]
169 fn test_completion_return_value() { 318 fn test_completion_return_value() {
170 check_keyword_completion( 319 assert_debug_snapshot_matches!(
171 "keywords_in_function3", 320 do_keyword_completion(
172 r" 321 r"
173 fn quux() -> i32 { 322 fn quux() -> i32 {
174 <|> 323 <|>
175 92 324 92
176 } 325 }
177 ", 326 ",
327 ),
328 @r###"[
329 CompletionItem {
330 label: "if",
331 source_range: [56; 56),
332 delete: [56; 56),
333 insert: "if $0 {}",
334 kind: Keyword,
335 },
336 CompletionItem {
337 label: "loop",
338 source_range: [56; 56),
339 delete: [56; 56),
340 insert: "loop {$0}",
341 kind: Keyword,
342 },
343 CompletionItem {
344 label: "match",
345 source_range: [56; 56),
346 delete: [56; 56),
347 insert: "match $0 {}",
348 kind: Keyword,
349 },
350 CompletionItem {
351 label: "return",
352 source_range: [56; 56),
353 delete: [56; 56),
354 insert: "return $0;",
355 kind: Keyword,
356 },
357 CompletionItem {
358 label: "while",
359 source_range: [56; 56),
360 delete: [56; 56),
361 insert: "while $0 {}",
362 kind: Keyword,
363 },
364]"###
178 ); 365 );
179 check_keyword_completion( 366 assert_debug_snapshot_matches!(
180 "keywords_in_function4", 367 do_keyword_completion(
181 r" 368 r"
182 fn quux() { 369 fn quux() {
183 <|> 370 <|>
184 92 371 92
185 } 372 }
186 ", 373 ",
374 ),
375 @r###"[
376 CompletionItem {
377 label: "if",
378 source_range: [49; 49),
379 delete: [49; 49),
380 insert: "if $0 {}",
381 kind: Keyword,
382 },
383 CompletionItem {
384 label: "loop",
385 source_range: [49; 49),
386 delete: [49; 49),
387 insert: "loop {$0}",
388 kind: Keyword,
389 },
390 CompletionItem {
391 label: "match",
392 source_range: [49; 49),
393 delete: [49; 49),
394 insert: "match $0 {}",
395 kind: Keyword,
396 },
397 CompletionItem {
398 label: "return",
399 source_range: [49; 49),
400 delete: [49; 49),
401 insert: "return;",
402 kind: Keyword,
403 },
404 CompletionItem {
405 label: "while",
406 source_range: [49; 49),
407 delete: [49; 49),
408 insert: "while $0 {}",
409 kind: Keyword,
410 },
411]"###
187 ); 412 );
188 } 413 }
189 414
190 #[test] 415 #[test]
191 fn dont_add_semi_after_return_if_not_a_statement() { 416 fn dont_add_semi_after_return_if_not_a_statement() {
192 check_keyword_completion( 417 assert_debug_snapshot_matches!(
193 "dont_add_semi_after_return_if_not_a_statement", 418 do_keyword_completion(
194 r" 419 r"
195 fn quux() -> i32 { 420 fn quux() -> i32 {
196 match () { 421 match () {
197 () => <|> 422 () => <|>
423 }
198 } 424 }
199 } 425 ",
200 ", 426 ),
427 @r###"[
428 CompletionItem {
429 label: "if",
430 source_range: [97; 97),
431 delete: [97; 97),
432 insert: "if $0 {}",
433 kind: Keyword,
434 },
435 CompletionItem {
436 label: "loop",
437 source_range: [97; 97),
438 delete: [97; 97),
439 insert: "loop {$0}",
440 kind: Keyword,
441 },
442 CompletionItem {
443 label: "match",
444 source_range: [97; 97),
445 delete: [97; 97),
446 insert: "match $0 {}",
447 kind: Keyword,
448 },
449 CompletionItem {
450 label: "return",
451 source_range: [97; 97),
452 delete: [97; 97),
453 insert: "return $0",
454 kind: Keyword,
455 },
456 CompletionItem {
457 label: "while",
458 source_range: [97; 97),
459 delete: [97; 97),
460 insert: "while $0 {}",
461 kind: Keyword,
462 },
463]"###
201 ); 464 );
202 } 465 }
203 466
204 #[test] 467 #[test]
205 fn last_return_in_block_has_semi() { 468 fn last_return_in_block_has_semi() {
206 check_keyword_completion( 469 assert_debug_snapshot_matches!(
207 "last_return_in_block_has_semi1", 470 do_keyword_completion(
208 r" 471 r"
209 fn quux() -> i32 { 472 fn quux() -> i32 {
210 if condition { 473 if condition {
211 <|> 474 <|>
475 }
212 } 476 }
213 } 477 ",
214 ", 478 ),
479 @r###"[
480 CompletionItem {
481 label: "if",
482 source_range: [95; 95),
483 delete: [95; 95),
484 insert: "if $0 {}",
485 kind: Keyword,
486 },
487 CompletionItem {
488 label: "loop",
489 source_range: [95; 95),
490 delete: [95; 95),
491 insert: "loop {$0}",
492 kind: Keyword,
493 },
494 CompletionItem {
495 label: "match",
496 source_range: [95; 95),
497 delete: [95; 95),
498 insert: "match $0 {}",
499 kind: Keyword,
500 },
501 CompletionItem {
502 label: "return",
503 source_range: [95; 95),
504 delete: [95; 95),
505 insert: "return $0;",
506 kind: Keyword,
507 },
508 CompletionItem {
509 label: "while",
510 source_range: [95; 95),
511 delete: [95; 95),
512 insert: "while $0 {}",
513 kind: Keyword,
514 },
515]"###
215 ); 516 );
216 check_keyword_completion( 517 assert_debug_snapshot_matches!(
217 "last_return_in_block_has_semi2", 518 do_keyword_completion(
218 r" 519 r"
219 fn quux() -> i32 { 520 fn quux() -> i32 {
220 if condition { 521 if condition {
221 <|> 522 <|>
523 }
524 let x = 92;
525 x
222 } 526 }
223 let x = 92; 527 ",
224 x 528 ),
225 } 529 @r###"[
226 ", 530 CompletionItem {
531 label: "if",
532 source_range: [95; 95),
533 delete: [95; 95),
534 insert: "if $0 {}",
535 kind: Keyword,
536 },
537 CompletionItem {
538 label: "loop",
539 source_range: [95; 95),
540 delete: [95; 95),
541 insert: "loop {$0}",
542 kind: Keyword,
543 },
544 CompletionItem {
545 label: "match",
546 source_range: [95; 95),
547 delete: [95; 95),
548 insert: "match $0 {}",
549 kind: Keyword,
550 },
551 CompletionItem {
552 label: "return",
553 source_range: [95; 95),
554 delete: [95; 95),
555 insert: "return $0;",
556 kind: Keyword,
557 },
558 CompletionItem {
559 label: "while",
560 source_range: [95; 95),
561 delete: [95; 95),
562 insert: "while $0 {}",
563 kind: Keyword,
564 },
565]"###
227 ); 566 );
228 } 567 }
229 568
230 #[test] 569 #[test]
231 fn completes_break_and_continue_in_loops() { 570 fn completes_break_and_continue_in_loops() {
232 check_keyword_completion( 571 assert_debug_snapshot_matches!(
233 "completes_break_and_continue_in_loops1", 572 do_keyword_completion(
234 r" 573 r"
235 fn quux() -> i32 { 574 fn quux() -> i32 {
236 loop { <|> } 575 loop { <|> }
237 } 576 }
238 ", 577 ",
578 ),
579 @r###"[
580 CompletionItem {
581 label: "break",
582 source_range: [63; 63),
583 delete: [63; 63),
584 insert: "break;",
585 kind: Keyword,
586 },
587 CompletionItem {
588 label: "continue",
589 source_range: [63; 63),
590 delete: [63; 63),
591 insert: "continue;",
592 kind: Keyword,
593 },
594 CompletionItem {
595 label: "if",
596 source_range: [63; 63),
597 delete: [63; 63),
598 insert: "if $0 {}",
599 kind: Keyword,
600 },
601 CompletionItem {
602 label: "loop",
603 source_range: [63; 63),
604 delete: [63; 63),
605 insert: "loop {$0}",
606 kind: Keyword,
607 },
608 CompletionItem {
609 label: "match",
610 source_range: [63; 63),
611 delete: [63; 63),
612 insert: "match $0 {}",
613 kind: Keyword,
614 },
615 CompletionItem {
616 label: "return",
617 source_range: [63; 63),
618 delete: [63; 63),
619 insert: "return $0;",
620 kind: Keyword,
621 },
622 CompletionItem {
623 label: "while",
624 source_range: [63; 63),
625 delete: [63; 63),
626 insert: "while $0 {}",
627 kind: Keyword,
628 },
629]"###
239 ); 630 );
240 631
241 // No completion: lambda isolates control flow 632 // No completion: lambda isolates control flow
242 check_keyword_completion( 633 assert_debug_snapshot_matches!(
243 "completes_break_and_continue_in_loops2", 634 do_keyword_completion(
244 r" 635 r"
245 fn quux() -> i32 { 636 fn quux() -> i32 {
246 loop { || { <|> } } 637 loop { || { <|> } }
247 } 638 }
248 ", 639 ",
640 ),
641 @r###"[
642 CompletionItem {
643 label: "if",
644 source_range: [68; 68),
645 delete: [68; 68),
646 insert: "if $0 {}",
647 kind: Keyword,
648 },
649 CompletionItem {
650 label: "loop",
651 source_range: [68; 68),
652 delete: [68; 68),
653 insert: "loop {$0}",
654 kind: Keyword,
655 },
656 CompletionItem {
657 label: "match",
658 source_range: [68; 68),
659 delete: [68; 68),
660 insert: "match $0 {}",
661 kind: Keyword,
662 },
663 CompletionItem {
664 label: "return",
665 source_range: [68; 68),
666 delete: [68; 68),
667 insert: "return $0;",
668 kind: Keyword,
669 },
670 CompletionItem {
671 label: "while",
672 source_range: [68; 68),
673 delete: [68; 68),
674 insert: "while $0 {}",
675 kind: Keyword,
676 },
677]"###
249 ); 678 );
250 } 679 }
251 680
252 #[test] 681 #[test]
253 fn no_semi_after_break_continue_in_expr() { 682 fn no_semi_after_break_continue_in_expr() {
254 check_keyword_completion( 683 assert_debug_snapshot_matches!(
255 "no_semi_after_break_continue_in_expr", 684 do_keyword_completion(
256 r" 685 r"
257 fn f() { 686 fn f() {
258 loop { 687 loop {
259 match () { 688 match () {
260 () => br<|> 689 () => br<|>
690 }
261 } 691 }
262 } 692 }
263 } 693 ",
264 ", 694 ),
695 @r###"[
696 CompletionItem {
697 label: "break",
698 source_range: [122; 124),
699 delete: [122; 124),
700 insert: "break",
701 kind: Keyword,
702 },
703 CompletionItem {
704 label: "continue",
705 source_range: [122; 124),
706 delete: [122; 124),
707 insert: "continue",
708 kind: Keyword,
709 },
710 CompletionItem {
711 label: "if",
712 source_range: [122; 124),
713 delete: [122; 124),
714 insert: "if $0 {}",
715 kind: Keyword,
716 },
717 CompletionItem {
718 label: "loop",
719 source_range: [122; 124),
720 delete: [122; 124),
721 insert: "loop {$0}",
722 kind: Keyword,
723 },
724 CompletionItem {
725 label: "match",
726 source_range: [122; 124),
727 delete: [122; 124),
728 insert: "match $0 {}",
729 kind: Keyword,
730 },
731 CompletionItem {
732 label: "return",
733 source_range: [122; 124),
734 delete: [122; 124),
735 insert: "return",
736 kind: Keyword,
737 },
738 CompletionItem {
739 label: "while",
740 source_range: [122; 124),
741 delete: [122; 124),
742 insert: "while $0 {}",
743 kind: Keyword,
744 },
745]"###
265 ) 746 )
266 } 747 }
267} 748}
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
deleted file mode 100644
index b6f95c1ff..000000000
--- a/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops1.snap
+++ /dev/null
@@ -1,57 +0,0 @@
1---
2created: "2019-05-23T22:23:35.067956470Z"
3creator: [email protected]
4source: crates/ra_ide_api/src/completion/completion_item.rs
5expression: kind_completions
6---
7[
8 CompletionItem {
9 label: "break",
10 source_range: [55; 55),
11 delete: [55; 55),
12 insert: "break;",
13 kind: Keyword,
14 },
15 CompletionItem {
16 label: "continue",
17 source_range: [55; 55),
18 delete: [55; 55),
19 insert: "continue;",
20 kind: Keyword,
21 },
22 CompletionItem {
23 label: "if",
24 source_range: [55; 55),
25 delete: [55; 55),
26 insert: "if $0 {}",
27 kind: Keyword,
28 },
29 CompletionItem {
30 label: "loop",
31 source_range: [55; 55),
32 delete: [55; 55),
33 insert: "loop {$0}",
34 kind: Keyword,
35 },
36 CompletionItem {
37 label: "match",
38 source_range: [55; 55),
39 delete: [55; 55),
40 insert: "match $0 {}",
41 kind: Keyword,
42 },
43 CompletionItem {
44 label: "return",
45 source_range: [55; 55),
46 delete: [55; 55),
47 insert: "return $0;",
48 kind: Keyword,
49 },
50 CompletionItem {
51 label: "while",
52 source_range: [55; 55),
53 delete: [55; 55),
54 insert: "while $0 {}",
55 kind: Keyword,
56 },
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
deleted file mode 100644
index 9b37478ef..000000000
--- a/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops2.snap
+++ /dev/null
@@ -1,43 +0,0 @@
1---
2created: "2019-05-23T22:44:10.859967190Z"
3creator: [email protected]
4source: crates/ra_ide_api/src/completion/completion_item.rs
5expression: kind_completions
6---
7[
8 CompletionItem {
9 label: "if",
10 source_range: [60; 60),
11 delete: [60; 60),
12 insert: "if $0 {}",
13 kind: Keyword,
14 },
15 CompletionItem {
16 label: "loop",
17 source_range: [60; 60),
18 delete: [60; 60),
19 insert: "loop {$0}",
20 kind: Keyword,
21 },
22 CompletionItem {
23 label: "match",
24 source_range: [60; 60),
25 delete: [60; 60),
26 insert: "match $0 {}",
27 kind: Keyword,
28 },
29 CompletionItem {
30 label: "return",
31 source_range: [60; 60),
32 delete: [60; 60),
33 insert: "return $0;",
34 kind: Keyword,
35 },
36 CompletionItem {
37 label: "while",
38 source_range: [60; 60),
39 delete: [60; 60),
40 insert: "while $0 {}",
41 kind: Keyword,
42 },
43]
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
deleted file mode 100644
index 9d320c715..000000000
--- a/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_add_semi_after_return_if_not_a_statement.snap
+++ /dev/null
@@ -1,43 +0,0 @@
1---
2created: "2019-05-23T22:23:35.081993214Z"
3creator: [email protected]
4source: crates/ra_ide_api/src/completion/completion_item.rs
5expression: kind_completions
6---
7[
8 CompletionItem {
9 label: "if",
10 source_range: [85; 85),
11 delete: [85; 85),
12 insert: "if $0 {}",
13 kind: Keyword,
14 },
15 CompletionItem {
16 label: "loop",
17 source_range: [85; 85),
18 delete: [85; 85),
19 insert: "loop {$0}",
20 kind: Keyword,
21 },
22 CompletionItem {
23 label: "match",
24 source_range: [85; 85),
25 delete: [85; 85),
26 insert: "match $0 {}",
27 kind: Keyword,
28 },
29 CompletionItem {
30 label: "return",
31 source_range: [85; 85),
32 delete: [85; 85),
33 insert: "return $0",
34 kind: Keyword,
35 },
36 CompletionItem {
37 label: "while",
38 source_range: [85; 85),
39 delete: [85; 85),
40 insert: "while $0 {}",
41 kind: Keyword,
42 },
43]
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
deleted file mode 100644
index 34a44bb70..000000000
--- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function1.snap
+++ /dev/null
@@ -1,43 +0,0 @@
1---
2created: "2019-05-23T22:23:35.075690846Z"
3creator: [email protected]
4source: crates/ra_ide_api/src/completion/completion_item.rs
5expression: kind_completions
6---
7[
8 CompletionItem {
9 label: "if",
10 source_range: [41; 41),
11 delete: [41; 41),
12 insert: "if $0 {}",
13 kind: Keyword,
14 },
15 CompletionItem {
16 label: "loop",
17 source_range: [41; 41),
18 delete: [41; 41),
19 insert: "loop {$0}",
20 kind: Keyword,
21 },
22 CompletionItem {
23 label: "match",
24 source_range: [41; 41),
25 delete: [41; 41),
26 insert: "match $0 {}",
27 kind: Keyword,
28 },
29 CompletionItem {
30 label: "return",
31 source_range: [41; 41),
32 delete: [41; 41),
33 insert: "return;",
34 kind: Keyword,
35 },
36 CompletionItem {
37 label: "while",
38 source_range: [41; 41),
39 delete: [41; 41),
40 insert: "while $0 {}",
41 kind: Keyword,
42 },
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
deleted file mode 100644
index ac744f362..000000000
--- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function2.snap
+++ /dev/null
@@ -1,57 +0,0 @@
1---
2created: "2019-05-23T22:23:35.068799431Z"
3creator: [email protected]
4source: crates/ra_ide_api/src/completion/completion_item.rs
5expression: kind_completions
6---
7[
8 CompletionItem {
9 label: "else",
10 source_range: [92; 92),
11 delete: [92; 92),
12 insert: "else {$0}",
13 kind: Keyword,
14 },
15 CompletionItem {
16 label: "else if",
17 source_range: [92; 92),
18 delete: [92; 92),
19 insert: "else if $0 {}",
20 kind: Keyword,
21 },
22 CompletionItem {
23 label: "if",
24 source_range: [92; 92),
25 delete: [92; 92),
26 insert: "if $0 {}",
27 kind: Keyword,
28 },
29 CompletionItem {
30 label: "loop",
31 source_range: [92; 92),
32 delete: [92; 92),
33 insert: "loop {$0}",
34 kind: Keyword,
35 },
36 CompletionItem {
37 label: "match",
38 source_range: [92; 92),
39 delete: [92; 92),
40 insert: "match $0 {}",
41 kind: Keyword,
42 },
43 CompletionItem {
44 label: "return",
45 source_range: [92; 92),
46 delete: [92; 92),
47 insert: "return;",
48 kind: Keyword,
49 },
50 CompletionItem {
51 label: "while",
52 source_range: [92; 92),
53 delete: [92; 92),
54 insert: "while $0 {}",
55 kind: Keyword,
56 },
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
deleted file mode 100644
index 1098ecf54..000000000
--- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function3.snap
+++ /dev/null
@@ -1,43 +0,0 @@
1---
2created: "2019-05-23T22:23:35.085655258Z"
3creator: [email protected]
4source: crates/ra_ide_api/src/completion/completion_item.rs
5expression: kind_completions
6---
7[
8 CompletionItem {
9 label: "if",
10 source_range: [48; 48),
11 delete: [48; 48),
12 insert: "if $0 {}",
13 kind: Keyword,
14 },
15 CompletionItem {
16 label: "loop",
17 source_range: [48; 48),
18 delete: [48; 48),
19 insert: "loop {$0}",
20 kind: Keyword,
21 },
22 CompletionItem {
23 label: "match",
24 source_range: [48; 48),
25 delete: [48; 48),
26 insert: "match $0 {}",
27 kind: Keyword,
28 },
29 CompletionItem {
30 label: "return",
31 source_range: [48; 48),
32 delete: [48; 48),
33 insert: "return $0;",
34 kind: Keyword,
35 },
36 CompletionItem {
37 label: "while",
38 source_range: [48; 48),
39 delete: [48; 48),
40 insert: "while $0 {}",
41 kind: Keyword,
42 },
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
deleted file mode 100644
index 3c5eca1ba..000000000
--- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function4.snap
+++ /dev/null
@@ -1,43 +0,0 @@
1---
2created: "2019-05-23T22:44:10.869539856Z"
3creator: [email protected]
4source: crates/ra_ide_api/src/completion/completion_item.rs
5expression: kind_completions
6---
7[
8 CompletionItem {
9 label: "if",
10 source_range: [41; 41),
11 delete: [41; 41),
12 insert: "if $0 {}",
13 kind: Keyword,
14 },
15 CompletionItem {
16 label: "loop",
17 source_range: [41; 41),
18 delete: [41; 41),
19 insert: "loop {$0}",
20 kind: Keyword,
21 },
22 CompletionItem {
23 label: "match",
24 source_range: [41; 41),
25 delete: [41; 41),
26 insert: "match $0 {}",
27 kind: Keyword,
28 },
29 CompletionItem {
30 label: "return",
31 source_range: [41; 41),
32 delete: [41; 41),
33 insert: "return;",
34 kind: Keyword,
35 },
36 CompletionItem {
37 label: "while",
38 source_range: [41; 41),
39 delete: [41; 41),
40 insert: "while $0 {}",
41 kind: Keyword,
42 },
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
deleted file mode 100644
index 71d7e9de8..000000000
--- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt1.snap
+++ /dev/null
@@ -1,29 +0,0 @@
1---
2created: "2019-05-23T22:23:35.066687241Z"
3creator: [email protected]
4source: crates/ra_ide_api/src/completion/completion_item.rs
5expression: kind_completions
6---
7[
8 CompletionItem {
9 label: "crate",
10 source_range: [17; 17),
11 delete: [17; 17),
12 insert: "crate::",
13 kind: Keyword,
14 },
15 CompletionItem {
16 label: "self",
17 source_range: [17; 17),
18 delete: [17; 17),
19 insert: "self",
20 kind: Keyword,
21 },
22 CompletionItem {
23 label: "super",
24 source_range: [17; 17),
25 delete: [17; 17),
26 insert: "super::",
27 kind: Keyword,
28 },
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
deleted file mode 100644
index ad156fb44..000000000
--- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt2.snap
+++ /dev/null
@@ -1,22 +0,0 @@
1---
2created: "2019-05-23T22:44:10.859494330Z"
3creator: [email protected]
4source: crates/ra_ide_api/src/completion/completion_item.rs
5expression: kind_completions
6---
7[
8 CompletionItem {
9 label: "self",
10 source_range: [20; 20),
11 delete: [20; 20),
12 insert: "self",
13 kind: Keyword,
14 },
15 CompletionItem {
16 label: "super",
17 source_range: [20; 20),
18 delete: [20; 20),
19 insert: "super::",
20 kind: Keyword,
21 },
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
deleted file mode 100644
index e7b11d532..000000000
--- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt3.snap
+++ /dev/null
@@ -1,22 +0,0 @@
1---
2created: "2019-05-23T22:44:40.506690279Z"
3creator: [email protected]
4source: crates/ra_ide_api/src/completion/completion_item.rs
5expression: kind_completions
6---
7[
8 CompletionItem {
9 label: "self",
10 source_range: [24; 24),
11 delete: [24; 24),
12 insert: "self",
13 kind: Keyword,
14 },
15 CompletionItem {
16 label: "super",
17 source_range: [24; 24),
18 delete: [24; 24),
19 insert: "super::",
20 kind: Keyword,
21 },
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
deleted file mode 100644
index e7069dc0c..000000000
--- a/crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi1.snap
+++ /dev/null
@@ -1,43 +0,0 @@
1---
2created: "2019-05-23T22:23:35.082403612Z"
3creator: [email protected]
4source: crates/ra_ide_api/src/completion/completion_item.rs
5expression: kind_completions
6---
7[
8 CompletionItem {
9 label: "if",
10 source_range: [83; 83),
11 delete: [83; 83),
12 insert: "if $0 {}",
13 kind: Keyword,
14 },
15 CompletionItem {
16 label: "loop",
17 source_range: [83; 83),
18 delete: [83; 83),
19 insert: "loop {$0}",
20 kind: Keyword,
21 },
22 CompletionItem {
23 label: "match",
24 source_range: [83; 83),
25 delete: [83; 83),
26 insert: "match $0 {}",
27 kind: Keyword,
28 },
29 CompletionItem {
30 label: "return",
31 source_range: [83; 83),
32 delete: [83; 83),
33 insert: "return $0;",
34 kind: Keyword,
35 },
36 CompletionItem {
37 label: "while",
38 source_range: [83; 83),
39 delete: [83; 83),
40 insert: "while $0 {}",
41 kind: Keyword,
42 },
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
deleted file mode 100644
index 47beb904b..000000000
--- a/crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi2.snap
+++ /dev/null
@@ -1,43 +0,0 @@
1---
2created: "2019-05-23T22:44:10.871868390Z"
3creator: [email protected]
4source: crates/ra_ide_api/src/completion/completion_item.rs
5expression: kind_completions
6---
7[
8 CompletionItem {
9 label: "if",
10 source_range: [83; 83),
11 delete: [83; 83),
12 insert: "if $0 {}",
13 kind: Keyword,
14 },
15 CompletionItem {
16 label: "loop",
17 source_range: [83; 83),
18 delete: [83; 83),
19 insert: "loop {$0}",
20 kind: Keyword,
21 },
22 CompletionItem {
23 label: "match",
24 source_range: [83; 83),
25 delete: [83; 83),
26 insert: "match $0 {}",
27 kind: Keyword,
28 },
29 CompletionItem {
30 label: "return",
31 source_range: [83; 83),
32 delete: [83; 83),
33 insert: "return $0;",
34 kind: Keyword,
35 },
36 CompletionItem {
37 label: "while",
38 source_range: [83; 83),
39 delete: [83; 83),
40 insert: "while $0 {}",
41 kind: Keyword,
42 },
43]
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
deleted file mode 100644
index 22e25fe3d..000000000
--- a/crates/ra_ide_api/src/completion/snapshots/completion_item__no_semi_after_break_continue_in_expr.snap
+++ /dev/null
@@ -1,57 +0,0 @@
1---
2created: "2019-05-23T22:23:35.085365816Z"
3creator: [email protected]
4source: crates/ra_ide_api/src/completion/completion_item.rs
5expression: kind_completions
6---
7[
8 CompletionItem {
9 label: "break",
10 source_range: [106; 108),
11 delete: [106; 108),
12 insert: "break",
13 kind: Keyword,
14 },
15 CompletionItem {
16 label: "continue",
17 source_range: [106; 108),
18 delete: [106; 108),
19 insert: "continue",
20 kind: Keyword,
21 },
22 CompletionItem {
23 label: "if",
24 source_range: [106; 108),
25 delete: [106; 108),
26 insert: "if $0 {}",
27 kind: Keyword,
28 },
29 CompletionItem {
30 label: "loop",
31 source_range: [106; 108),
32 delete: [106; 108),
33 insert: "loop {$0}",
34 kind: Keyword,
35 },
36 CompletionItem {
37 label: "match",
38 source_range: [106; 108),
39 delete: [106; 108),
40 insert: "match $0 {}",
41 kind: Keyword,
42 },
43 CompletionItem {
44 label: "return",
45 source_range: [106; 108),
46 delete: [106; 108),
47 insert: "return",
48 kind: Keyword,
49 },
50 CompletionItem {
51 label: "while",
52 source_range: [106; 108),
53 delete: [106; 108),
54 insert: "while $0 {}",
55 kind: Keyword,
56 },
57]