diff options
Diffstat (limited to 'crates/ide/src/runnables.rs')
-rw-r--r-- | crates/ide/src/runnables.rs | 139 |
1 files changed, 17 insertions, 122 deletions
diff --git a/crates/ide/src/runnables.rs b/crates/ide/src/runnables.rs index 600e93b6a..ff386be80 100644 --- a/crates/ide/src/runnables.rs +++ b/crates/ide/src/runnables.rs | |||
@@ -208,7 +208,7 @@ fn module_def_doctest(sema: &Semantics<RootDatabase>, def: hir::ModuleDef) -> Op | |||
208 | nav.focus_range = None; | 208 | nav.focus_range = None; |
209 | nav.description = None; | 209 | nav.description = None; |
210 | nav.docs = None; | 210 | nav.docs = None; |
211 | nav.kind = SymbolKind::DocTest; | 211 | nav.kind = None; |
212 | let res = Runnable { nav, kind: RunnableKind::DocTest { test_id }, cfg: attrs.cfg() }; | 212 | let res = Runnable { nav, kind: RunnableKind::DocTest { test_id }, cfg: attrs.cfg() }; |
213 | Some(res) | 213 | Some(res) |
214 | } | 214 | } |
@@ -352,14 +352,9 @@ fn bench() {} | |||
352 | 0, | 352 | 0, |
353 | ), | 353 | ), |
354 | full_range: 1..13, | 354 | full_range: 1..13, |
355 | focus_range: Some( | 355 | focus_range: 4..8, |
356 | 4..8, | ||
357 | ), | ||
358 | name: "main", | 356 | name: "main", |
359 | kind: Function, | 357 | kind: Function, |
360 | container_name: None, | ||
361 | description: None, | ||
362 | docs: None, | ||
363 | }, | 358 | }, |
364 | kind: Bin, | 359 | kind: Bin, |
365 | cfg: None, | 360 | cfg: None, |
@@ -370,14 +365,9 @@ fn bench() {} | |||
370 | 0, | 365 | 0, |
371 | ), | 366 | ), |
372 | full_range: 15..39, | 367 | full_range: 15..39, |
373 | focus_range: Some( | 368 | focus_range: 26..34, |
374 | 26..34, | ||
375 | ), | ||
376 | name: "test_foo", | 369 | name: "test_foo", |
377 | kind: Function, | 370 | kind: Function, |
378 | container_name: None, | ||
379 | description: None, | ||
380 | docs: None, | ||
381 | }, | 371 | }, |
382 | kind: Test { | 372 | kind: Test { |
383 | test_id: Path( | 373 | test_id: Path( |
@@ -395,14 +385,9 @@ fn bench() {} | |||
395 | 0, | 385 | 0, |
396 | ), | 386 | ), |
397 | full_range: 41..75, | 387 | full_range: 41..75, |
398 | focus_range: Some( | 388 | focus_range: 62..70, |
399 | 62..70, | ||
400 | ), | ||
401 | name: "test_foo", | 389 | name: "test_foo", |
402 | kind: Function, | 390 | kind: Function, |
403 | container_name: None, | ||
404 | description: None, | ||
405 | docs: None, | ||
406 | }, | 391 | }, |
407 | kind: Test { | 392 | kind: Test { |
408 | test_id: Path( | 393 | test_id: Path( |
@@ -420,14 +405,9 @@ fn bench() {} | |||
420 | 0, | 405 | 0, |
421 | ), | 406 | ), |
422 | full_range: 77..99, | 407 | full_range: 77..99, |
423 | focus_range: Some( | 408 | focus_range: 89..94, |
424 | 89..94, | ||
425 | ), | ||
426 | name: "bench", | 409 | name: "bench", |
427 | kind: Function, | 410 | kind: Function, |
428 | container_name: None, | ||
429 | description: None, | ||
430 | docs: None, | ||
431 | }, | 411 | }, |
432 | kind: Bench { | 412 | kind: Bench { |
433 | test_id: Path( | 413 | test_id: Path( |
@@ -517,14 +497,9 @@ struct StructWithRunnable(String); | |||
517 | 0, | 497 | 0, |
518 | ), | 498 | ), |
519 | full_range: 1..13, | 499 | full_range: 1..13, |
520 | focus_range: Some( | 500 | focus_range: 4..8, |
521 | 4..8, | ||
522 | ), | ||
523 | name: "main", | 501 | name: "main", |
524 | kind: Function, | 502 | kind: Function, |
525 | container_name: None, | ||
526 | description: None, | ||
527 | docs: None, | ||
528 | }, | 503 | }, |
529 | kind: Bin, | 504 | kind: Bin, |
530 | cfg: None, | 505 | cfg: None, |
@@ -535,12 +510,7 @@ struct StructWithRunnable(String); | |||
535 | 0, | 510 | 0, |
536 | ), | 511 | ), |
537 | full_range: 15..74, | 512 | full_range: 15..74, |
538 | focus_range: None, | ||
539 | name: "should_have_runnable", | 513 | name: "should_have_runnable", |
540 | kind: DocTest, | ||
541 | container_name: None, | ||
542 | description: None, | ||
543 | docs: None, | ||
544 | }, | 514 | }, |
545 | kind: DocTest { | 515 | kind: DocTest { |
546 | test_id: Path( | 516 | test_id: Path( |
@@ -555,12 +525,7 @@ struct StructWithRunnable(String); | |||
555 | 0, | 525 | 0, |
556 | ), | 526 | ), |
557 | full_range: 76..148, | 527 | full_range: 76..148, |
558 | focus_range: None, | ||
559 | name: "should_have_runnable_1", | 528 | name: "should_have_runnable_1", |
560 | kind: DocTest, | ||
561 | container_name: None, | ||
562 | description: None, | ||
563 | docs: None, | ||
564 | }, | 529 | }, |
565 | kind: DocTest { | 530 | kind: DocTest { |
566 | test_id: Path( | 531 | test_id: Path( |
@@ -575,12 +540,7 @@ struct StructWithRunnable(String); | |||
575 | 0, | 540 | 0, |
576 | ), | 541 | ), |
577 | full_range: 150..254, | 542 | full_range: 150..254, |
578 | focus_range: None, | ||
579 | name: "should_have_runnable_2", | 543 | name: "should_have_runnable_2", |
580 | kind: DocTest, | ||
581 | container_name: None, | ||
582 | description: None, | ||
583 | docs: None, | ||
584 | }, | 544 | }, |
585 | kind: DocTest { | 545 | kind: DocTest { |
586 | test_id: Path( | 546 | test_id: Path( |
@@ -595,12 +555,7 @@ struct StructWithRunnable(String); | |||
595 | 0, | 555 | 0, |
596 | ), | 556 | ), |
597 | full_range: 756..821, | 557 | full_range: 756..821, |
598 | focus_range: None, | ||
599 | name: "StructWithRunnable", | 558 | name: "StructWithRunnable", |
600 | kind: DocTest, | ||
601 | container_name: None, | ||
602 | description: None, | ||
603 | docs: None, | ||
604 | }, | 559 | }, |
605 | kind: DocTest { | 560 | kind: DocTest { |
606 | test_id: Path( | 561 | test_id: Path( |
@@ -639,14 +594,9 @@ impl Data { | |||
639 | 0, | 594 | 0, |
640 | ), | 595 | ), |
641 | full_range: 1..13, | 596 | full_range: 1..13, |
642 | focus_range: Some( | 597 | focus_range: 4..8, |
643 | 4..8, | ||
644 | ), | ||
645 | name: "main", | 598 | name: "main", |
646 | kind: Function, | 599 | kind: Function, |
647 | container_name: None, | ||
648 | description: None, | ||
649 | docs: None, | ||
650 | }, | 600 | }, |
651 | kind: Bin, | 601 | kind: Bin, |
652 | cfg: None, | 602 | cfg: None, |
@@ -657,12 +607,7 @@ impl Data { | |||
657 | 0, | 607 | 0, |
658 | ), | 608 | ), |
659 | full_range: 44..98, | 609 | full_range: 44..98, |
660 | focus_range: None, | ||
661 | name: "foo", | 610 | name: "foo", |
662 | kind: DocTest, | ||
663 | container_name: None, | ||
664 | description: None, | ||
665 | docs: None, | ||
666 | }, | 611 | }, |
667 | kind: DocTest { | 612 | kind: DocTest { |
668 | test_id: Path( | 613 | test_id: Path( |
@@ -696,14 +641,9 @@ mod test_mod { | |||
696 | 0, | 641 | 0, |
697 | ), | 642 | ), |
698 | full_range: 1..51, | 643 | full_range: 1..51, |
699 | focus_range: Some( | 644 | focus_range: 5..13, |
700 | 5..13, | ||
701 | ), | ||
702 | name: "test_mod", | 645 | name: "test_mod", |
703 | kind: Module, | 646 | kind: Module, |
704 | container_name: None, | ||
705 | description: None, | ||
706 | docs: None, | ||
707 | }, | 647 | }, |
708 | kind: TestMod { | 648 | kind: TestMod { |
709 | path: "test_mod", | 649 | path: "test_mod", |
@@ -716,14 +656,9 @@ mod test_mod { | |||
716 | 0, | 656 | 0, |
717 | ), | 657 | ), |
718 | full_range: 20..49, | 658 | full_range: 20..49, |
719 | focus_range: Some( | 659 | focus_range: 35..44, |
720 | 35..44, | ||
721 | ), | ||
722 | name: "test_foo1", | 660 | name: "test_foo1", |
723 | kind: Function, | 661 | kind: Function, |
724 | container_name: None, | ||
725 | description: None, | ||
726 | docs: None, | ||
727 | }, | 662 | }, |
728 | kind: Test { | 663 | kind: Test { |
729 | test_id: Path( | 664 | test_id: Path( |
@@ -776,14 +711,9 @@ mod root_tests { | |||
776 | 0, | 711 | 0, |
777 | ), | 712 | ), |
778 | full_range: 22..323, | 713 | full_range: 22..323, |
779 | focus_range: Some( | 714 | focus_range: 26..40, |
780 | 26..40, | ||
781 | ), | ||
782 | name: "nested_tests_0", | 715 | name: "nested_tests_0", |
783 | kind: Module, | 716 | kind: Module, |
784 | container_name: None, | ||
785 | description: None, | ||
786 | docs: None, | ||
787 | }, | 717 | }, |
788 | kind: TestMod { | 718 | kind: TestMod { |
789 | path: "root_tests::nested_tests_0", | 719 | path: "root_tests::nested_tests_0", |
@@ -796,14 +726,9 @@ mod root_tests { | |||
796 | 0, | 726 | 0, |
797 | ), | 727 | ), |
798 | full_range: 51..192, | 728 | full_range: 51..192, |
799 | focus_range: Some( | 729 | focus_range: 55..69, |
800 | 55..69, | ||
801 | ), | ||
802 | name: "nested_tests_1", | 730 | name: "nested_tests_1", |
803 | kind: Module, | 731 | kind: Module, |
804 | container_name: None, | ||
805 | description: None, | ||
806 | docs: None, | ||
807 | }, | 732 | }, |
808 | kind: TestMod { | 733 | kind: TestMod { |
809 | path: "root_tests::nested_tests_0::nested_tests_1", | 734 | path: "root_tests::nested_tests_0::nested_tests_1", |
@@ -816,14 +741,9 @@ mod root_tests { | |||
816 | 0, | 741 | 0, |
817 | ), | 742 | ), |
818 | full_range: 84..126, | 743 | full_range: 84..126, |
819 | focus_range: Some( | 744 | focus_range: 107..121, |
820 | 107..121, | ||
821 | ), | ||
822 | name: "nested_test_11", | 745 | name: "nested_test_11", |
823 | kind: Function, | 746 | kind: Function, |
824 | container_name: None, | ||
825 | description: None, | ||
826 | docs: None, | ||
827 | }, | 747 | }, |
828 | kind: Test { | 748 | kind: Test { |
829 | test_id: Path( | 749 | test_id: Path( |
@@ -841,14 +761,9 @@ mod root_tests { | |||
841 | 0, | 761 | 0, |
842 | ), | 762 | ), |
843 | full_range: 140..182, | 763 | full_range: 140..182, |
844 | focus_range: Some( | 764 | focus_range: 163..177, |
845 | 163..177, | ||
846 | ), | ||
847 | name: "nested_test_12", | 765 | name: "nested_test_12", |
848 | kind: Function, | 766 | kind: Function, |
849 | container_name: None, | ||
850 | description: None, | ||
851 | docs: None, | ||
852 | }, | 767 | }, |
853 | kind: Test { | 768 | kind: Test { |
854 | test_id: Path( | 769 | test_id: Path( |
@@ -866,14 +781,9 @@ mod root_tests { | |||
866 | 0, | 781 | 0, |
867 | ), | 782 | ), |
868 | full_range: 202..286, | 783 | full_range: 202..286, |
869 | focus_range: Some( | 784 | focus_range: 206..220, |
870 | 206..220, | ||
871 | ), | ||
872 | name: "nested_tests_2", | 785 | name: "nested_tests_2", |
873 | kind: Module, | 786 | kind: Module, |
874 | container_name: None, | ||
875 | description: None, | ||
876 | docs: None, | ||
877 | }, | 787 | }, |
878 | kind: TestMod { | 788 | kind: TestMod { |
879 | path: "root_tests::nested_tests_0::nested_tests_2", | 789 | path: "root_tests::nested_tests_0::nested_tests_2", |
@@ -886,14 +796,9 @@ mod root_tests { | |||
886 | 0, | 796 | 0, |
887 | ), | 797 | ), |
888 | full_range: 235..276, | 798 | full_range: 235..276, |
889 | focus_range: Some( | 799 | focus_range: 258..271, |
890 | 258..271, | ||
891 | ), | ||
892 | name: "nested_test_2", | 800 | name: "nested_test_2", |
893 | kind: Function, | 801 | kind: Function, |
894 | container_name: None, | ||
895 | description: None, | ||
896 | docs: None, | ||
897 | }, | 802 | }, |
898 | kind: Test { | 803 | kind: Test { |
899 | test_id: Path( | 804 | test_id: Path( |
@@ -929,14 +834,9 @@ fn test_foo1() {} | |||
929 | 0, | 834 | 0, |
930 | ), | 835 | ), |
931 | full_range: 1..50, | 836 | full_range: 1..50, |
932 | focus_range: Some( | 837 | focus_range: 36..45, |
933 | 36..45, | ||
934 | ), | ||
935 | name: "test_foo1", | 838 | name: "test_foo1", |
936 | kind: Function, | 839 | kind: Function, |
937 | container_name: None, | ||
938 | description: None, | ||
939 | docs: None, | ||
940 | }, | 840 | }, |
941 | kind: Test { | 841 | kind: Test { |
942 | test_id: Path( | 842 | test_id: Path( |
@@ -979,14 +879,9 @@ fn test_foo1() {} | |||
979 | 0, | 879 | 0, |
980 | ), | 880 | ), |
981 | full_range: 1..72, | 881 | full_range: 1..72, |
982 | focus_range: Some( | 882 | focus_range: 58..67, |
983 | 58..67, | ||
984 | ), | ||
985 | name: "test_foo1", | 883 | name: "test_foo1", |
986 | kind: Function, | 884 | kind: Function, |
987 | container_name: None, | ||
988 | description: None, | ||
989 | docs: None, | ||
990 | }, | 885 | }, |
991 | kind: Test { | 886 | kind: Test { |
992 | test_id: Path( | 887 | test_id: Path( |