aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/completion/complete_postfix.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-06-24 10:34:25 +0100
committerGitHub <[email protected]>2020-06-24 10:34:25 +0100
commit7c28d060b5a5c4e7004282aa6827c3023c5b03c8 (patch)
tree0ed66d422a10a9f192a039565ac70b85dbdf80f8 /crates/ra_ide/src/completion/complete_postfix.rs
parent15c71f881607db5ddfd759785f62e4ae44aaf301 (diff)
parentc749fe223bf5a41709a4bc91d0f56dafc4201658 (diff)
Merge #5021
5021: Reduce code dupication around fixtures r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/completion/complete_postfix.rs')
-rw-r--r--crates/ra_ide/src/completion/complete_postfix.rs220
1 files changed, 110 insertions, 110 deletions
diff --git a/crates/ra_ide/src/completion/complete_postfix.rs b/crates/ra_ide/src/completion/complete_postfix.rs
index b878aeb0a..3bd64804f 100644
--- a/crates/ra_ide/src/completion/complete_postfix.rs
+++ b/crates/ra_ide/src/completion/complete_postfix.rs
@@ -260,64 +260,64 @@ mod tests {
260 [ 260 [
261 CompletionItem { 261 CompletionItem {
262 label: "box", 262 label: "box",
263 source_range: 89..89, 263 source_range: 40..40,
264 delete: 85..89, 264 delete: 36..40,
265 insert: "Box::new(bar)", 265 insert: "Box::new(bar)",
266 detail: "Box::new(expr)", 266 detail: "Box::new(expr)",
267 }, 267 },
268 CompletionItem { 268 CompletionItem {
269 label: "call", 269 label: "call",
270 source_range: 89..89, 270 source_range: 40..40,
271 delete: 85..89, 271 delete: 36..40,
272 insert: "${1}(bar)", 272 insert: "${1}(bar)",
273 detail: "function(expr)", 273 detail: "function(expr)",
274 }, 274 },
275 CompletionItem { 275 CompletionItem {
276 label: "dbg", 276 label: "dbg",
277 source_range: 89..89, 277 source_range: 40..40,
278 delete: 85..89, 278 delete: 36..40,
279 insert: "dbg!(bar)", 279 insert: "dbg!(bar)",
280 detail: "dbg!(expr)", 280 detail: "dbg!(expr)",
281 }, 281 },
282 CompletionItem { 282 CompletionItem {
283 label: "if", 283 label: "if",
284 source_range: 89..89, 284 source_range: 40..40,
285 delete: 85..89, 285 delete: 36..40,
286 insert: "if bar {\n $0\n}", 286 insert: "if bar {\n $0\n}",
287 detail: "if expr {}", 287 detail: "if expr {}",
288 }, 288 },
289 CompletionItem { 289 CompletionItem {
290 label: "match", 290 label: "match",
291 source_range: 89..89, 291 source_range: 40..40,
292 delete: 85..89, 292 delete: 36..40,
293 insert: "match bar {\n ${1:_} => {$0\\},\n}", 293 insert: "match bar {\n ${1:_} => {$0\\},\n}",
294 detail: "match expr {}", 294 detail: "match expr {}",
295 }, 295 },
296 CompletionItem { 296 CompletionItem {
297 label: "not", 297 label: "not",
298 source_range: 89..89, 298 source_range: 40..40,
299 delete: 85..89, 299 delete: 36..40,
300 insert: "!bar", 300 insert: "!bar",
301 detail: "!expr", 301 detail: "!expr",
302 }, 302 },
303 CompletionItem { 303 CompletionItem {
304 label: "ref", 304 label: "ref",
305 source_range: 89..89, 305 source_range: 40..40,
306 delete: 85..89, 306 delete: 36..40,
307 insert: "&bar", 307 insert: "&bar",
308 detail: "&expr", 308 detail: "&expr",
309 }, 309 },
310 CompletionItem { 310 CompletionItem {
311 label: "refm", 311 label: "refm",
312 source_range: 89..89, 312 source_range: 40..40,
313 delete: 85..89, 313 delete: 36..40,
314 insert: "&mut bar", 314 insert: "&mut bar",
315 detail: "&mut expr", 315 detail: "&mut expr",
316 }, 316 },
317 CompletionItem { 317 CompletionItem {
318 label: "while", 318 label: "while",
319 source_range: 89..89, 319 source_range: 40..40,
320 delete: 85..89, 320 delete: 36..40,
321 insert: "while bar {\n $0\n}", 321 insert: "while bar {\n $0\n}",
322 detail: "while expr {}", 322 detail: "while expr {}",
323 }, 323 },
@@ -346,64 +346,64 @@ mod tests {
346 [ 346 [
347 CompletionItem { 347 CompletionItem {
348 label: "box", 348 label: "box",
349 source_range: 210..210, 349 source_range: 97..97,
350 delete: 206..210, 350 delete: 93..97,
351 insert: "Box::new(bar)", 351 insert: "Box::new(bar)",
352 detail: "Box::new(expr)", 352 detail: "Box::new(expr)",
353 }, 353 },
354 CompletionItem { 354 CompletionItem {
355 label: "call", 355 label: "call",
356 source_range: 210..210, 356 source_range: 97..97,
357 delete: 206..210, 357 delete: 93..97,
358 insert: "${1}(bar)", 358 insert: "${1}(bar)",
359 detail: "function(expr)", 359 detail: "function(expr)",
360 }, 360 },
361 CompletionItem { 361 CompletionItem {
362 label: "dbg", 362 label: "dbg",
363 source_range: 210..210, 363 source_range: 97..97,
364 delete: 206..210, 364 delete: 93..97,
365 insert: "dbg!(bar)", 365 insert: "dbg!(bar)",
366 detail: "dbg!(expr)", 366 detail: "dbg!(expr)",
367 }, 367 },
368 CompletionItem { 368 CompletionItem {
369 label: "ifl", 369 label: "ifl",
370 source_range: 210..210, 370 source_range: 97..97,
371 delete: 206..210, 371 delete: 93..97,
372 insert: "if let Some($1) = bar {\n $0\n}", 372 insert: "if let Some($1) = bar {\n $0\n}",
373 detail: "if let Some {}", 373 detail: "if let Some {}",
374 }, 374 },
375 CompletionItem { 375 CompletionItem {
376 label: "match", 376 label: "match",
377 source_range: 210..210, 377 source_range: 97..97,
378 delete: 206..210, 378 delete: 93..97,
379 insert: "match bar {\n Some(${1:_}) => {$2\\},\n None => {$0\\},\n}", 379 insert: "match bar {\n Some(${1:_}) => {$2\\},\n None => {$0\\},\n}",
380 detail: "match expr {}", 380 detail: "match expr {}",
381 }, 381 },
382 CompletionItem { 382 CompletionItem {
383 label: "not", 383 label: "not",
384 source_range: 210..210, 384 source_range: 97..97,
385 delete: 206..210, 385 delete: 93..97,
386 insert: "!bar", 386 insert: "!bar",
387 detail: "!expr", 387 detail: "!expr",
388 }, 388 },
389 CompletionItem { 389 CompletionItem {
390 label: "ref", 390 label: "ref",
391 source_range: 210..210, 391 source_range: 97..97,
392 delete: 206..210, 392 delete: 93..97,
393 insert: "&bar", 393 insert: "&bar",
394 detail: "&expr", 394 detail: "&expr",
395 }, 395 },
396 CompletionItem { 396 CompletionItem {
397 label: "refm", 397 label: "refm",
398 source_range: 210..210, 398 source_range: 97..97,
399 delete: 206..210, 399 delete: 93..97,
400 insert: "&mut bar", 400 insert: "&mut bar",
401 detail: "&mut expr", 401 detail: "&mut expr",
402 }, 402 },
403 CompletionItem { 403 CompletionItem {
404 label: "while", 404 label: "while",
405 source_range: 210..210, 405 source_range: 97..97,
406 delete: 206..210, 406 delete: 93..97,
407 insert: "while let Some($1) = bar {\n $0\n}", 407 insert: "while let Some($1) = bar {\n $0\n}",
408 detail: "while let Some {}", 408 detail: "while let Some {}",
409 }, 409 },
@@ -432,64 +432,64 @@ mod tests {
432 [ 432 [
433 CompletionItem { 433 CompletionItem {
434 label: "box", 434 label: "box",
435 source_range: 211..211, 435 source_range: 98..98,
436 delete: 207..211, 436 delete: 94..98,
437 insert: "Box::new(bar)", 437 insert: "Box::new(bar)",
438 detail: "Box::new(expr)", 438 detail: "Box::new(expr)",
439 }, 439 },
440 CompletionItem { 440 CompletionItem {
441 label: "call", 441 label: "call",
442 source_range: 211..211, 442 source_range: 98..98,
443 delete: 207..211, 443 delete: 94..98,
444 insert: "${1}(bar)", 444 insert: "${1}(bar)",
445 detail: "function(expr)", 445 detail: "function(expr)",
446 }, 446 },
447 CompletionItem { 447 CompletionItem {
448 label: "dbg", 448 label: "dbg",
449 source_range: 211..211, 449 source_range: 98..98,
450 delete: 207..211, 450 delete: 94..98,
451 insert: "dbg!(bar)", 451 insert: "dbg!(bar)",
452 detail: "dbg!(expr)", 452 detail: "dbg!(expr)",
453 }, 453 },
454 CompletionItem { 454 CompletionItem {
455 label: "ifl", 455 label: "ifl",
456 source_range: 211..211, 456 source_range: 98..98,
457 delete: 207..211, 457 delete: 94..98,
458 insert: "if let Ok($1) = bar {\n $0\n}", 458 insert: "if let Ok($1) = bar {\n $0\n}",
459 detail: "if let Ok {}", 459 detail: "if let Ok {}",
460 }, 460 },
461 CompletionItem { 461 CompletionItem {
462 label: "match", 462 label: "match",
463 source_range: 211..211, 463 source_range: 98..98,
464 delete: 207..211, 464 delete: 94..98,
465 insert: "match bar {\n Ok(${1:_}) => {$2\\},\n Err(${3:_}) => {$0\\},\n}", 465 insert: "match bar {\n Ok(${1:_}) => {$2\\},\n Err(${3:_}) => {$0\\},\n}",
466 detail: "match expr {}", 466 detail: "match expr {}",
467 }, 467 },
468 CompletionItem { 468 CompletionItem {
469 label: "not", 469 label: "not",
470 source_range: 211..211, 470 source_range: 98..98,
471 delete: 207..211, 471 delete: 94..98,
472 insert: "!bar", 472 insert: "!bar",
473 detail: "!expr", 473 detail: "!expr",
474 }, 474 },
475 CompletionItem { 475 CompletionItem {
476 label: "ref", 476 label: "ref",
477 source_range: 211..211, 477 source_range: 98..98,
478 delete: 207..211, 478 delete: 94..98,
479 insert: "&bar", 479 insert: "&bar",
480 detail: "&expr", 480 detail: "&expr",
481 }, 481 },
482 CompletionItem { 482 CompletionItem {
483 label: "refm", 483 label: "refm",
484 source_range: 211..211, 484 source_range: 98..98,
485 delete: 207..211, 485 delete: 94..98,
486 insert: "&mut bar", 486 insert: "&mut bar",
487 detail: "&mut expr", 487 detail: "&mut expr",
488 }, 488 },
489 CompletionItem { 489 CompletionItem {
490 label: "while", 490 label: "while",
491 source_range: 211..211, 491 source_range: 98..98,
492 delete: 207..211, 492 delete: 94..98,
493 insert: "while let Ok($1) = bar {\n $0\n}", 493 insert: "while let Ok($1) = bar {\n $0\n}",
494 detail: "while let Ok {}", 494 detail: "while let Ok {}",
495 }, 495 },
@@ -513,50 +513,50 @@ mod tests {
513 [ 513 [
514 CompletionItem { 514 CompletionItem {
515 label: "box", 515 label: "box",
516 source_range: 91..91, 516 source_range: 42..42,
517 delete: 87..91, 517 delete: 38..42,
518 insert: "Box::new(bar)", 518 insert: "Box::new(bar)",
519 detail: "Box::new(expr)", 519 detail: "Box::new(expr)",
520 }, 520 },
521 CompletionItem { 521 CompletionItem {
522 label: "call", 522 label: "call",
523 source_range: 91..91, 523 source_range: 42..42,
524 delete: 87..91, 524 delete: 38..42,
525 insert: "${1}(bar)", 525 insert: "${1}(bar)",
526 detail: "function(expr)", 526 detail: "function(expr)",
527 }, 527 },
528 CompletionItem { 528 CompletionItem {
529 label: "dbg", 529 label: "dbg",
530 source_range: 91..91, 530 source_range: 42..42,
531 delete: 87..91, 531 delete: 38..42,
532 insert: "dbg!(bar)", 532 insert: "dbg!(bar)",
533 detail: "dbg!(expr)", 533 detail: "dbg!(expr)",
534 }, 534 },
535 CompletionItem { 535 CompletionItem {
536 label: "match", 536 label: "match",
537 source_range: 91..91, 537 source_range: 42..42,
538 delete: 87..91, 538 delete: 38..42,
539 insert: "match bar {\n ${1:_} => {$0\\},\n}", 539 insert: "match bar {\n ${1:_} => {$0\\},\n}",
540 detail: "match expr {}", 540 detail: "match expr {}",
541 }, 541 },
542 CompletionItem { 542 CompletionItem {
543 label: "not", 543 label: "not",
544 source_range: 91..91, 544 source_range: 42..42,
545 delete: 87..91, 545 delete: 38..42,
546 insert: "!bar", 546 insert: "!bar",
547 detail: "!expr", 547 detail: "!expr",
548 }, 548 },
549 CompletionItem { 549 CompletionItem {
550 label: "ref", 550 label: "ref",
551 source_range: 91..91, 551 source_range: 42..42,
552 delete: 87..91, 552 delete: 38..42,
553 insert: "&bar", 553 insert: "&bar",
554 detail: "&expr", 554 detail: "&expr",
555 }, 555 },
556 CompletionItem { 556 CompletionItem {
557 label: "refm", 557 label: "refm",
558 source_range: 91..91, 558 source_range: 42..42,
559 delete: 87..91, 559 delete: 38..42,
560 insert: "&mut bar", 560 insert: "&mut bar",
561 detail: "&mut expr", 561 detail: "&mut expr",
562 }, 562 },
@@ -579,50 +579,50 @@ mod tests {
579 [ 579 [
580 CompletionItem { 580 CompletionItem {
581 label: "box", 581 label: "box",
582 source_range: 52..52, 582 source_range: 19..19,
583 delete: 49..52, 583 delete: 16..19,
584 insert: "Box::new(42)", 584 insert: "Box::new(42)",
585 detail: "Box::new(expr)", 585 detail: "Box::new(expr)",
586 }, 586 },
587 CompletionItem { 587 CompletionItem {
588 label: "call", 588 label: "call",
589 source_range: 52..52, 589 source_range: 19..19,
590 delete: 49..52, 590 delete: 16..19,
591 insert: "${1}(42)", 591 insert: "${1}(42)",
592 detail: "function(expr)", 592 detail: "function(expr)",
593 }, 593 },
594 CompletionItem { 594 CompletionItem {
595 label: "dbg", 595 label: "dbg",
596 source_range: 52..52, 596 source_range: 19..19,
597 delete: 49..52, 597 delete: 16..19,
598 insert: "dbg!(42)", 598 insert: "dbg!(42)",
599 detail: "dbg!(expr)", 599 detail: "dbg!(expr)",
600 }, 600 },
601 CompletionItem { 601 CompletionItem {
602 label: "match", 602 label: "match",
603 source_range: 52..52, 603 source_range: 19..19,
604 delete: 49..52, 604 delete: 16..19,
605 insert: "match 42 {\n ${1:_} => {$0\\},\n}", 605 insert: "match 42 {\n ${1:_} => {$0\\},\n}",
606 detail: "match expr {}", 606 detail: "match expr {}",
607 }, 607 },
608 CompletionItem { 608 CompletionItem {
609 label: "not", 609 label: "not",
610 source_range: 52..52, 610 source_range: 19..19,
611 delete: 49..52, 611 delete: 16..19,
612 insert: "!42", 612 insert: "!42",
613 detail: "!expr", 613 detail: "!expr",
614 }, 614 },
615 CompletionItem { 615 CompletionItem {
616 label: "ref", 616 label: "ref",
617 source_range: 52..52, 617 source_range: 19..19,
618 delete: 49..52, 618 delete: 16..19,
619 insert: "&42", 619 insert: "&42",
620 detail: "&expr", 620 detail: "&expr",
621 }, 621 },
622 CompletionItem { 622 CompletionItem {
623 label: "refm", 623 label: "refm",
624 source_range: 52..52, 624 source_range: 19..19,
625 delete: 49..52, 625 delete: 16..19,
626 insert: "&mut 42", 626 insert: "&mut 42",
627 detail: "&mut expr", 627 detail: "&mut expr",
628 }, 628 },
@@ -647,50 +647,50 @@ mod tests {
647 [ 647 [
648 CompletionItem { 648 CompletionItem {
649 label: "box", 649 label: "box",
650 source_range: 149..150, 650 source_range: 84..85,
651 delete: 145..150, 651 delete: 80..85,
652 insert: "Box::new(bar)", 652 insert: "Box::new(bar)",
653 detail: "Box::new(expr)", 653 detail: "Box::new(expr)",
654 }, 654 },
655 CompletionItem { 655 CompletionItem {
656 label: "call", 656 label: "call",
657 source_range: 149..150, 657 source_range: 84..85,
658 delete: 145..150, 658 delete: 80..85,
659 insert: "${1}(bar)", 659 insert: "${1}(bar)",
660 detail: "function(expr)", 660 detail: "function(expr)",
661 }, 661 },
662 CompletionItem { 662 CompletionItem {
663 label: "dbg", 663 label: "dbg",
664 source_range: 149..150, 664 source_range: 84..85,
665 delete: 145..150, 665 delete: 80..85,
666 insert: "dbg!(bar)", 666 insert: "dbg!(bar)",
667 detail: "dbg!(expr)", 667 detail: "dbg!(expr)",
668 }, 668 },
669 CompletionItem { 669 CompletionItem {
670 label: "match", 670 label: "match",
671 source_range: 149..150, 671 source_range: 84..85,
672 delete: 145..150, 672 delete: 80..85,
673 insert: "match bar {\n ${1:_} => {$0\\},\n}", 673 insert: "match bar {\n ${1:_} => {$0\\},\n}",
674 detail: "match expr {}", 674 detail: "match expr {}",
675 }, 675 },
676 CompletionItem { 676 CompletionItem {
677 label: "not", 677 label: "not",
678 source_range: 149..150, 678 source_range: 84..85,
679 delete: 145..150, 679 delete: 80..85,
680 insert: "!bar", 680 insert: "!bar",
681 detail: "!expr", 681 detail: "!expr",
682 }, 682 },
683 CompletionItem { 683 CompletionItem {
684 label: "ref", 684 label: "ref",
685 source_range: 149..150, 685 source_range: 84..85,
686 delete: 145..150, 686 delete: 80..85,
687 insert: "&bar", 687 insert: "&bar",
688 detail: "&expr", 688 detail: "&expr",
689 }, 689 },
690 CompletionItem { 690 CompletionItem {
691 label: "refm", 691 label: "refm",
692 source_range: 149..150, 692 source_range: 84..85,
693 delete: 145..150, 693 delete: 80..85,
694 insert: "&mut bar", 694 insert: "&mut bar",
695 detail: "&mut expr", 695 detail: "&mut expr",
696 }, 696 },
@@ -713,50 +713,50 @@ mod tests {
713 [ 713 [
714 CompletionItem { 714 CompletionItem {
715 label: "box", 715 label: "box",
716 source_range: 56..56, 716 source_range: 23..23,
717 delete: 49..56, 717 delete: 16..23,
718 insert: "Box::new(&&&&42)", 718 insert: "Box::new(&&&&42)",
719 detail: "Box::new(expr)", 719 detail: "Box::new(expr)",
720 }, 720 },
721 CompletionItem { 721 CompletionItem {
722 label: "call", 722 label: "call",
723 source_range: 56..56, 723 source_range: 23..23,
724 delete: 49..56, 724 delete: 16..23,
725 insert: "${1}(&&&&42)", 725 insert: "${1}(&&&&42)",
726 detail: "function(expr)", 726 detail: "function(expr)",
727 }, 727 },
728 CompletionItem { 728 CompletionItem {
729 label: "dbg", 729 label: "dbg",
730 source_range: 56..56, 730 source_range: 23..23,
731 delete: 49..56, 731 delete: 16..23,
732 insert: "dbg!(&&&&42)", 732 insert: "dbg!(&&&&42)",
733 detail: "dbg!(expr)", 733 detail: "dbg!(expr)",
734 }, 734 },
735 CompletionItem { 735 CompletionItem {
736 label: "match", 736 label: "match",
737 source_range: 56..56, 737 source_range: 23..23,
738 delete: 49..56, 738 delete: 16..23,
739 insert: "match &&&&42 {\n ${1:_} => {$0\\},\n}", 739 insert: "match &&&&42 {\n ${1:_} => {$0\\},\n}",
740 detail: "match expr {}", 740 detail: "match expr {}",
741 }, 741 },
742 CompletionItem { 742 CompletionItem {
743 label: "not", 743 label: "not",
744 source_range: 56..56, 744 source_range: 23..23,
745 delete: 53..56, 745 delete: 20..23,
746 insert: "!42", 746 insert: "!42",
747 detail: "!expr", 747 detail: "!expr",
748 }, 748 },
749 CompletionItem { 749 CompletionItem {
750 label: "ref", 750 label: "ref",
751 source_range: 56..56, 751 source_range: 23..23,
752 delete: 53..56, 752 delete: 20..23,
753 insert: "&42", 753 insert: "&42",
754 detail: "&expr", 754 detail: "&expr",
755 }, 755 },
756 CompletionItem { 756 CompletionItem {
757 label: "refm", 757 label: "refm",
758 source_range: 56..56, 758 source_range: 23..23,
759 delete: 53..56, 759 delete: 20..23,
760 insert: "&mut 42", 760 insert: "&mut 42",
761 detail: "&mut expr", 761 detail: "&mut expr",
762 }, 762 },