diff options
Diffstat (limited to 'crates/ra_ide/src/completion')
3 files changed, 88 insertions, 88 deletions
diff --git a/crates/ra_ide/src/completion/complete_macro_in_item_position.rs b/crates/ra_ide/src/completion/complete_macro_in_item_position.rs index d9bb5fd25..4c33f41d4 100644 --- a/crates/ra_ide/src/completion/complete_macro_in_item_position.rs +++ b/crates/ra_ide/src/completion/complete_macro_in_item_position.rs | |||
@@ -42,8 +42,8 @@ mod tests { | |||
42 | [ | 42 | [ |
43 | CompletionItem { | 43 | CompletionItem { |
44 | label: "foo!(…)", | 44 | label: "foo!(…)", |
45 | source_range: 46..46, | 45 | source_range: 48..48, |
46 | delete: 46..46, | 46 | delete: 48..48, |
47 | insert: "foo!($0)", | 47 | insert: "foo!($0)", |
48 | kind: Macro, | 48 | kind: Macro, |
49 | detail: "macro_rules! foo", | 49 | detail: "macro_rules! foo", |
@@ -82,8 +82,8 @@ mod tests { | |||
82 | [ | 82 | [ |
83 | CompletionItem { | 83 | CompletionItem { |
84 | label: "vec![…]", | 84 | label: "vec![…]", |
85 | source_range: 280..280, | 85 | source_range: 282..282, |
86 | delete: 280..280, | 86 | delete: 282..282, |
87 | insert: "vec![$0]", | 87 | insert: "vec![$0]", |
88 | kind: Macro, | 88 | kind: Macro, |
89 | detail: "macro_rules! vec", | 89 | detail: "macro_rules! vec", |
@@ -119,8 +119,8 @@ mod tests { | |||
119 | [ | 119 | [ |
120 | CompletionItem { | 120 | CompletionItem { |
121 | label: "foo! {…}", | 121 | label: "foo! {…}", |
122 | source_range: 163..163, | 122 | source_range: 164..164, |
123 | delete: 163..163, | 123 | delete: 164..164, |
124 | insert: "foo! {$0}", | 124 | insert: "foo! {$0}", |
125 | kind: Macro, | 125 | kind: Macro, |
126 | detail: "macro_rules! foo", | 126 | detail: "macro_rules! foo", |
@@ -130,8 +130,8 @@ mod tests { | |||
130 | }, | 130 | }, |
131 | CompletionItem { | 131 | CompletionItem { |
132 | label: "main()", | 132 | label: "main()", |
133 | source_range: 163..163, | 133 | source_range: 164..164, |
134 | delete: 163..163, | 134 | delete: 164..164, |
135 | insert: "main()$0", | 135 | insert: "main()$0", |
136 | kind: Function, | 136 | kind: Function, |
137 | lookup: "main", | 137 | lookup: "main", |
diff --git a/crates/ra_ide/src/completion/complete_qualified_path.rs b/crates/ra_ide/src/completion/complete_qualified_path.rs index 02ac0166b..d3a1cbc1d 100644 --- a/crates/ra_ide/src/completion/complete_qualified_path.rs +++ b/crates/ra_ide/src/completion/complete_qualified_path.rs | |||
@@ -541,8 +541,8 @@ mod tests { | |||
541 | [ | 541 | [ |
542 | CompletionItem { | 542 | CompletionItem { |
543 | label: "m()", | 543 | label: "m()", |
544 | source_range: 100..100, | 544 | source_range: 102..102, |
545 | delete: 100..100, | 545 | delete: 102..102, |
546 | insert: "m()$0", | 546 | insert: "m()$0", |
547 | kind: Function, | 547 | kind: Function, |
548 | lookup: "m", | 548 | lookup: "m", |
@@ -577,8 +577,8 @@ mod tests { | |||
577 | [ | 577 | [ |
578 | CompletionItem { | 578 | CompletionItem { |
579 | label: "m()", | 579 | label: "m()", |
580 | source_range: 105..105, | 580 | source_range: 107..107, |
581 | delete: 105..105, | 581 | delete: 107..107, |
582 | insert: "m()$0", | 582 | insert: "m()$0", |
583 | kind: Method, | 583 | kind: Method, |
584 | lookup: "m", | 584 | lookup: "m", |
@@ -613,8 +613,8 @@ mod tests { | |||
613 | [ | 613 | [ |
614 | CompletionItem { | 614 | CompletionItem { |
615 | label: "C", | 615 | label: "C", |
616 | source_range: 107..107, | 616 | source_range: 109..109, |
617 | delete: 107..107, | 617 | delete: 109..109, |
618 | insert: "C", | 618 | insert: "C", |
619 | kind: Const, | 619 | kind: Const, |
620 | detail: "const C: i32 = 42;", | 620 | detail: "const C: i32 = 42;", |
@@ -648,8 +648,8 @@ mod tests { | |||
648 | [ | 648 | [ |
649 | CompletionItem { | 649 | CompletionItem { |
650 | label: "T", | 650 | label: "T", |
651 | source_range: 101..101, | 651 | source_range: 103..103, |
652 | delete: 101..101, | 652 | delete: 103..103, |
653 | insert: "T", | 653 | insert: "T", |
654 | kind: TypeAlias, | 654 | kind: TypeAlias, |
655 | detail: "type T = i32;", | 655 | detail: "type T = i32;", |
@@ -688,24 +688,24 @@ mod tests { | |||
688 | [ | 688 | [ |
689 | CompletionItem { | 689 | CompletionItem { |
690 | label: "PUBLIC_CONST", | 690 | label: "PUBLIC_CONST", |
691 | source_range: 302..302, | 691 | source_range: 304..304, |
692 | delete: 302..302, | 692 | delete: 304..304, |
693 | insert: "PUBLIC_CONST", | 693 | insert: "PUBLIC_CONST", |
694 | kind: Const, | 694 | kind: Const, |
695 | detail: "pub(super) const PUBLIC_CONST: u32 = 1;", | 695 | detail: "pub(super) const PUBLIC_CONST: u32 = 1;", |
696 | }, | 696 | }, |
697 | CompletionItem { | 697 | CompletionItem { |
698 | label: "PublicType", | 698 | label: "PublicType", |
699 | source_range: 302..302, | 699 | source_range: 304..304, |
700 | delete: 302..302, | 700 | delete: 304..304, |
701 | insert: "PublicType", | 701 | insert: "PublicType", |
702 | kind: TypeAlias, | 702 | kind: TypeAlias, |
703 | detail: "pub(super) type PublicType = u32;", | 703 | detail: "pub(super) type PublicType = u32;", |
704 | }, | 704 | }, |
705 | CompletionItem { | 705 | CompletionItem { |
706 | label: "public_method()", | 706 | label: "public_method()", |
707 | source_range: 302..302, | 707 | source_range: 304..304, |
708 | delete: 302..302, | 708 | delete: 304..304, |
709 | insert: "public_method()$0", | 709 | insert: "public_method()$0", |
710 | kind: Function, | 710 | kind: Function, |
711 | lookup: "public_method", | 711 | lookup: "public_method", |
@@ -737,8 +737,8 @@ mod tests { | |||
737 | [ | 737 | [ |
738 | CompletionItem { | 738 | CompletionItem { |
739 | label: "m()", | 739 | label: "m()", |
740 | source_range: 100..100, | 740 | source_range: 102..102, |
741 | delete: 100..100, | 741 | delete: 102..102, |
742 | insert: "m()$0", | 742 | insert: "m()$0", |
743 | kind: Function, | 743 | kind: Function, |
744 | lookup: "m", | 744 | lookup: "m", |
@@ -773,8 +773,8 @@ mod tests { | |||
773 | [ | 773 | [ |
774 | CompletionItem { | 774 | CompletionItem { |
775 | label: "m()", | 775 | label: "m()", |
776 | source_range: 101..101, | 776 | source_range: 103..103, |
777 | delete: 101..101, | 777 | delete: 103..103, |
778 | insert: "m()$0", | 778 | insert: "m()$0", |
779 | kind: Function, | 779 | kind: Function, |
780 | lookup: "m", | 780 | lookup: "m", |
@@ -834,8 +834,8 @@ mod tests { | |||
834 | [ | 834 | [ |
835 | CompletionItem { | 835 | CompletionItem { |
836 | label: "m()", | 836 | label: "m()", |
837 | source_range: 73..73, | 837 | source_range: 74..74, |
838 | delete: 73..73, | 838 | delete: 74..74, |
839 | insert: "m()$0", | 839 | insert: "m()$0", |
840 | kind: Function, | 840 | kind: Function, |
841 | lookup: "m", | 841 | lookup: "m", |
@@ -870,8 +870,8 @@ mod tests { | |||
870 | [ | 870 | [ |
871 | CompletionItem { | 871 | CompletionItem { |
872 | label: "m()", | 872 | label: "m()", |
873 | source_range: 99..99, | 873 | source_range: 101..101, |
874 | delete: 99..99, | 874 | delete: 101..101, |
875 | insert: "m()$0", | 875 | insert: "m()$0", |
876 | kind: Function, | 876 | kind: Function, |
877 | lookup: "m", | 877 | lookup: "m", |
@@ -906,8 +906,8 @@ mod tests { | |||
906 | [ | 906 | [ |
907 | CompletionItem { | 907 | CompletionItem { |
908 | label: "m()", | 908 | label: "m()", |
909 | source_range: 110..110, | 909 | source_range: 112..112, |
910 | delete: 110..110, | 910 | delete: 112..112, |
911 | insert: "m()$0", | 911 | insert: "m()$0", |
912 | kind: Function, | 912 | kind: Function, |
913 | lookup: "m", | 913 | lookup: "m", |
@@ -950,40 +950,40 @@ mod tests { | |||
950 | [ | 950 | [ |
951 | CompletionItem { | 951 | CompletionItem { |
952 | label: "C2", | 952 | label: "C2", |
953 | source_range: 219..219, | 953 | source_range: 221..221, |
954 | delete: 219..219, | 954 | delete: 221..221, |
955 | insert: "C2", | 955 | insert: "C2", |
956 | kind: Const, | 956 | kind: Const, |
957 | detail: "const C2: ();", | 957 | detail: "const C2: ();", |
958 | }, | 958 | }, |
959 | CompletionItem { | 959 | CompletionItem { |
960 | label: "CONST", | 960 | label: "CONST", |
961 | source_range: 219..219, | 961 | source_range: 221..221, |
962 | delete: 219..219, | 962 | delete: 221..221, |
963 | insert: "CONST", | 963 | insert: "CONST", |
964 | kind: Const, | 964 | kind: Const, |
965 | detail: "const CONST: u8;", | 965 | detail: "const CONST: u8;", |
966 | }, | 966 | }, |
967 | CompletionItem { | 967 | CompletionItem { |
968 | label: "SubTy", | 968 | label: "SubTy", |
969 | source_range: 219..219, | 969 | source_range: 221..221, |
970 | delete: 219..219, | 970 | delete: 221..221, |
971 | insert: "SubTy", | 971 | insert: "SubTy", |
972 | kind: TypeAlias, | 972 | kind: TypeAlias, |
973 | detail: "type SubTy;", | 973 | detail: "type SubTy;", |
974 | }, | 974 | }, |
975 | CompletionItem { | 975 | CompletionItem { |
976 | label: "Ty", | 976 | label: "Ty", |
977 | source_range: 219..219, | 977 | source_range: 221..221, |
978 | delete: 219..219, | 978 | delete: 221..221, |
979 | insert: "Ty", | 979 | insert: "Ty", |
980 | kind: TypeAlias, | 980 | kind: TypeAlias, |
981 | detail: "type Ty;", | 981 | detail: "type Ty;", |
982 | }, | 982 | }, |
983 | CompletionItem { | 983 | CompletionItem { |
984 | label: "func()", | 984 | label: "func()", |
985 | source_range: 219..219, | 985 | source_range: 221..221, |
986 | delete: 219..219, | 986 | delete: 221..221, |
987 | insert: "func()$0", | 987 | insert: "func()$0", |
988 | kind: Function, | 988 | kind: Function, |
989 | lookup: "func", | 989 | lookup: "func", |
@@ -991,8 +991,8 @@ mod tests { | |||
991 | }, | 991 | }, |
992 | CompletionItem { | 992 | CompletionItem { |
993 | label: "method()", | 993 | label: "method()", |
994 | source_range: 219..219, | 994 | source_range: 221..221, |
995 | delete: 219..219, | 995 | delete: 221..221, |
996 | insert: "method()$0", | 996 | insert: "method()$0", |
997 | kind: Method, | 997 | kind: Method, |
998 | lookup: "method", | 998 | lookup: "method", |
@@ -1000,8 +1000,8 @@ mod tests { | |||
1000 | }, | 1000 | }, |
1001 | CompletionItem { | 1001 | CompletionItem { |
1002 | label: "subfunc()", | 1002 | label: "subfunc()", |
1003 | source_range: 219..219, | 1003 | source_range: 221..221, |
1004 | delete: 219..219, | 1004 | delete: 221..221, |
1005 | insert: "subfunc()$0", | 1005 | insert: "subfunc()$0", |
1006 | kind: Function, | 1006 | kind: Function, |
1007 | lookup: "subfunc", | 1007 | lookup: "subfunc", |
@@ -1009,8 +1009,8 @@ mod tests { | |||
1009 | }, | 1009 | }, |
1010 | CompletionItem { | 1010 | CompletionItem { |
1011 | label: "submethod()", | 1011 | label: "submethod()", |
1012 | source_range: 219..219, | 1012 | source_range: 221..221, |
1013 | delete: 219..219, | 1013 | delete: 221..221, |
1014 | insert: "submethod()$0", | 1014 | insert: "submethod()$0", |
1015 | kind: Method, | 1015 | kind: Method, |
1016 | lookup: "submethod", | 1016 | lookup: "submethod", |
@@ -1055,40 +1055,40 @@ mod tests { | |||
1055 | [ | 1055 | [ |
1056 | CompletionItem { | 1056 | CompletionItem { |
1057 | label: "C2", | 1057 | label: "C2", |
1058 | source_range: 365..365, | 1058 | source_range: 367..367, |
1059 | delete: 365..365, | 1059 | delete: 367..367, |
1060 | insert: "C2", | 1060 | insert: "C2", |
1061 | kind: Const, | 1061 | kind: Const, |
1062 | detail: "const C2: () = ();", | 1062 | detail: "const C2: () = ();", |
1063 | }, | 1063 | }, |
1064 | CompletionItem { | 1064 | CompletionItem { |
1065 | label: "CONST", | 1065 | label: "CONST", |
1066 | source_range: 365..365, | 1066 | source_range: 367..367, |
1067 | delete: 365..365, | 1067 | delete: 367..367, |
1068 | insert: "CONST", | 1068 | insert: "CONST", |
1069 | kind: Const, | 1069 | kind: Const, |
1070 | detail: "const CONST: u8 = 0;", | 1070 | detail: "const CONST: u8 = 0;", |
1071 | }, | 1071 | }, |
1072 | CompletionItem { | 1072 | CompletionItem { |
1073 | label: "SubTy", | 1073 | label: "SubTy", |
1074 | source_range: 365..365, | 1074 | source_range: 367..367, |
1075 | delete: 365..365, | 1075 | delete: 367..367, |
1076 | insert: "SubTy", | 1076 | insert: "SubTy", |
1077 | kind: TypeAlias, | 1077 | kind: TypeAlias, |
1078 | detail: "type SubTy;", | 1078 | detail: "type SubTy;", |
1079 | }, | 1079 | }, |
1080 | CompletionItem { | 1080 | CompletionItem { |
1081 | label: "Ty", | 1081 | label: "Ty", |
1082 | source_range: 365..365, | 1082 | source_range: 367..367, |
1083 | delete: 365..365, | 1083 | delete: 367..367, |
1084 | insert: "Ty", | 1084 | insert: "Ty", |
1085 | kind: TypeAlias, | 1085 | kind: TypeAlias, |
1086 | detail: "type Ty;", | 1086 | detail: "type Ty;", |
1087 | }, | 1087 | }, |
1088 | CompletionItem { | 1088 | CompletionItem { |
1089 | label: "func()", | 1089 | label: "func()", |
1090 | source_range: 365..365, | 1090 | source_range: 367..367, |
1091 | delete: 365..365, | 1091 | delete: 367..367, |
1092 | insert: "func()$0", | 1092 | insert: "func()$0", |
1093 | kind: Function, | 1093 | kind: Function, |
1094 | lookup: "func", | 1094 | lookup: "func", |
@@ -1096,8 +1096,8 @@ mod tests { | |||
1096 | }, | 1096 | }, |
1097 | CompletionItem { | 1097 | CompletionItem { |
1098 | label: "method()", | 1098 | label: "method()", |
1099 | source_range: 365..365, | 1099 | source_range: 367..367, |
1100 | delete: 365..365, | 1100 | delete: 367..367, |
1101 | insert: "method()$0", | 1101 | insert: "method()$0", |
1102 | kind: Method, | 1102 | kind: Method, |
1103 | lookup: "method", | 1103 | lookup: "method", |
@@ -1105,8 +1105,8 @@ mod tests { | |||
1105 | }, | 1105 | }, |
1106 | CompletionItem { | 1106 | CompletionItem { |
1107 | label: "subfunc()", | 1107 | label: "subfunc()", |
1108 | source_range: 365..365, | 1108 | source_range: 367..367, |
1109 | delete: 365..365, | 1109 | delete: 367..367, |
1110 | insert: "subfunc()$0", | 1110 | insert: "subfunc()$0", |
1111 | kind: Function, | 1111 | kind: Function, |
1112 | lookup: "subfunc", | 1112 | lookup: "subfunc", |
@@ -1114,8 +1114,8 @@ mod tests { | |||
1114 | }, | 1114 | }, |
1115 | CompletionItem { | 1115 | CompletionItem { |
1116 | label: "submethod()", | 1116 | label: "submethod()", |
1117 | source_range: 365..365, | 1117 | source_range: 367..367, |
1118 | delete: 365..365, | 1118 | delete: 367..367, |
1119 | insert: "submethod()$0", | 1119 | insert: "submethod()$0", |
1120 | kind: Method, | 1120 | kind: Method, |
1121 | lookup: "submethod", | 1121 | lookup: "submethod", |
diff --git a/crates/ra_ide/src/completion/complete_unqualified_path.rs b/crates/ra_ide/src/completion/complete_unqualified_path.rs index 68032c37e..aa2b07a2f 100644 --- a/crates/ra_ide/src/completion/complete_unqualified_path.rs +++ b/crates/ra_ide/src/completion/complete_unqualified_path.rs | |||
@@ -781,46 +781,46 @@ mod tests { | |||
781 | [ | 781 | [ |
782 | CompletionItem { | 782 | CompletionItem { |
783 | label: "bar!(…)", | 783 | label: "bar!(…)", |
784 | source_range: 252..252, | 784 | source_range: 256..256, |
785 | delete: 252..252, | 785 | delete: 256..256, |
786 | insert: "bar!($0)", | 786 | insert: "bar!($0)", |
787 | kind: Macro, | 787 | kind: Macro, |
788 | detail: "macro_rules! bar", | 788 | detail: "macro_rules! bar", |
789 | }, | 789 | }, |
790 | CompletionItem { | 790 | CompletionItem { |
791 | label: "baz!(…)", | 791 | label: "baz!(…)", |
792 | source_range: 252..252, | 792 | source_range: 256..256, |
793 | delete: 252..252, | 793 | delete: 256..256, |
794 | insert: "baz!($0)", | 794 | insert: "baz!($0)", |
795 | kind: Macro, | 795 | kind: Macro, |
796 | detail: "#[macro_export]\nmacro_rules! baz", | 796 | detail: "#[macro_export]\nmacro_rules! baz", |
797 | }, | 797 | }, |
798 | CompletionItem { | 798 | CompletionItem { |
799 | label: "foo!(…)", | 799 | label: "foo!(…)", |
800 | source_range: 252..252, | 800 | source_range: 256..256, |
801 | delete: 252..252, | 801 | delete: 256..256, |
802 | insert: "foo!($0)", | 802 | insert: "foo!($0)", |
803 | kind: Macro, | 803 | kind: Macro, |
804 | detail: "macro_rules! foo", | 804 | detail: "macro_rules! foo", |
805 | }, | 805 | }, |
806 | CompletionItem { | 806 | CompletionItem { |
807 | label: "m1", | 807 | label: "m1", |
808 | source_range: 252..252, | 808 | source_range: 256..256, |
809 | delete: 252..252, | 809 | delete: 256..256, |
810 | insert: "m1", | 810 | insert: "m1", |
811 | kind: Module, | 811 | kind: Module, |
812 | }, | 812 | }, |
813 | CompletionItem { | 813 | CompletionItem { |
814 | label: "m2", | 814 | label: "m2", |
815 | source_range: 252..252, | 815 | source_range: 256..256, |
816 | delete: 252..252, | 816 | delete: 256..256, |
817 | insert: "m2", | 817 | insert: "m2", |
818 | kind: Module, | 818 | kind: Module, |
819 | }, | 819 | }, |
820 | CompletionItem { | 820 | CompletionItem { |
821 | label: "main()", | 821 | label: "main()", |
822 | source_range: 252..252, | 822 | source_range: 256..256, |
823 | delete: 252..252, | 823 | delete: 256..256, |
824 | insert: "main()$0", | 824 | insert: "main()$0", |
825 | kind: Function, | 825 | kind: Function, |
826 | lookup: "main", | 826 | lookup: "main", |
@@ -850,16 +850,16 @@ mod tests { | |||
850 | [ | 850 | [ |
851 | CompletionItem { | 851 | CompletionItem { |
852 | label: "foo!(…)", | 852 | label: "foo!(…)", |
853 | source_range: 49..49, | 853 | source_range: 50..50, |
854 | delete: 49..49, | 854 | delete: 50..50, |
855 | insert: "foo!($0)", | 855 | insert: "foo!($0)", |
856 | kind: Macro, | 856 | kind: Macro, |
857 | detail: "macro_rules! foo", | 857 | detail: "macro_rules! foo", |
858 | }, | 858 | }, |
859 | CompletionItem { | 859 | CompletionItem { |
860 | label: "foo()", | 860 | label: "foo()", |
861 | source_range: 49..49, | 861 | source_range: 50..50, |
862 | delete: 49..49, | 862 | delete: 50..50, |
863 | insert: "foo()$0", | 863 | insert: "foo()$0", |
864 | kind: Function, | 864 | kind: Function, |
865 | lookup: "foo", | 865 | lookup: "foo", |
@@ -889,16 +889,16 @@ mod tests { | |||
889 | [ | 889 | [ |
890 | CompletionItem { | 890 | CompletionItem { |
891 | label: "foo!(…)", | 891 | label: "foo!(…)", |
892 | source_range: 57..57, | 892 | source_range: 58..58, |
893 | delete: 57..57, | 893 | delete: 58..58, |
894 | insert: "foo!($0)", | 894 | insert: "foo!($0)", |
895 | kind: Macro, | 895 | kind: Macro, |
896 | detail: "macro_rules! foo", | 896 | detail: "macro_rules! foo", |
897 | }, | 897 | }, |
898 | CompletionItem { | 898 | CompletionItem { |
899 | label: "main()", | 899 | label: "main()", |
900 | source_range: 57..57, | 900 | source_range: 58..58, |
901 | delete: 57..57, | 901 | delete: 58..58, |
902 | insert: "main()$0", | 902 | insert: "main()$0", |
903 | kind: Function, | 903 | kind: Function, |
904 | lookup: "main", | 904 | lookup: "main", |
@@ -928,16 +928,16 @@ mod tests { | |||
928 | [ | 928 | [ |
929 | CompletionItem { | 929 | CompletionItem { |
930 | label: "foo!(…)", | 930 | label: "foo!(…)", |
931 | source_range: 50..50, | 931 | source_range: 51..51, |
932 | delete: 50..50, | 932 | delete: 51..51, |
933 | insert: "foo!($0)", | 933 | insert: "foo!($0)", |
934 | kind: Macro, | 934 | kind: Macro, |
935 | detail: "macro_rules! foo", | 935 | detail: "macro_rules! foo", |
936 | }, | 936 | }, |
937 | CompletionItem { | 937 | CompletionItem { |
938 | label: "main()", | 938 | label: "main()", |
939 | source_range: 50..50, | 939 | source_range: 51..51, |
940 | delete: 50..50, | 940 | delete: 51..51, |
941 | insert: "main()$0", | 941 | insert: "main()$0", |
942 | kind: Function, | 942 | kind: Function, |
943 | lookup: "main", | 943 | lookup: "main", |