@@ -733,7 +733,7 @@ mod tests {
733
733
) {
734
734
let mut actual = get_all_items ( TEST_CONFIG , ra_fixture, None ) ;
735
735
actual. retain ( |it| kinds. contains ( & it. kind ) ) ;
736
- actual. sort_by_key ( |it| cmp:: Reverse ( it. relevance . score ( ) ) ) ;
736
+ actual. sort_by_key ( |it| ( cmp:: Reverse ( it. relevance . score ( ) ) , it . label . primary . clone ( ) ) ) ;
737
737
check_relevance_ ( actual, expect) ;
738
738
}
739
739
@@ -743,7 +743,7 @@ mod tests {
743
743
actual. retain ( |it| it. kind != CompletionItemKind :: Snippet ) ;
744
744
actual. retain ( |it| it. kind != CompletionItemKind :: Keyword ) ;
745
745
actual. retain ( |it| it. kind != CompletionItemKind :: BuiltinType ) ;
746
- actual. sort_by_key ( |it| cmp:: Reverse ( it. relevance . score ( ) ) ) ;
746
+ actual. sort_by_key ( |it| ( cmp:: Reverse ( it. relevance . score ( ) ) , it . label . primary . clone ( ) ) ) ;
747
747
check_relevance_ ( actual, expect) ;
748
748
}
749
749
@@ -824,9 +824,9 @@ fn main() {
824
824
st dep::test_mod_b::Struct {…} dep::test_mod_b::Struct { } [type_could_unify]
825
825
ex dep::test_mod_b::Struct { } [type_could_unify]
826
826
st Struct Struct [type_could_unify+requires_import]
827
+ md dep []
827
828
fn main() fn() []
828
829
fn test(…) fn(Struct) []
829
- md dep []
830
830
st Struct Struct [requires_import]
831
831
"# ] ] ,
832
832
) ;
@@ -862,9 +862,9 @@ fn main() {
862
862
"# ,
863
863
expect ! [ [ r#"
864
864
un Union Union [type_could_unify+requires_import]
865
+ md dep []
865
866
fn main() fn() []
866
867
fn test(…) fn(Union) []
867
- md dep []
868
868
en Union Union [requires_import]
869
869
"# ] ] ,
870
870
) ;
@@ -900,9 +900,9 @@ fn main() {
900
900
ev dep::test_mod_b::Enum::variant dep::test_mod_b::Enum::variant [type_could_unify]
901
901
ex dep::test_mod_b::Enum::variant [type_could_unify]
902
902
en Enum Enum [type_could_unify+requires_import]
903
+ md dep []
903
904
fn main() fn() []
904
905
fn test(…) fn(Enum) []
905
- md dep []
906
906
en Enum Enum [requires_import]
907
907
"# ] ] ,
908
908
) ;
@@ -937,9 +937,9 @@ fn main() {
937
937
expect ! [ [ r#"
938
938
ev dep::test_mod_b::Enum::Variant dep::test_mod_b::Enum::Variant [type_could_unify]
939
939
ex dep::test_mod_b::Enum::Variant [type_could_unify]
940
+ md dep []
940
941
fn main() fn() []
941
942
fn test(…) fn(Enum) []
942
- md dep []
943
943
"# ] ] ,
944
944
) ;
945
945
}
@@ -967,9 +967,9 @@ fn main() {
967
967
}
968
968
"# ,
969
969
expect ! [ [ r#"
970
+ md dep []
970
971
fn main() fn() []
971
972
fn test(…) fn(fn(usize) -> i32) []
972
- md dep []
973
973
fn function fn(usize) -> i32 [requires_import]
974
974
fn function(…) fn(isize) -> i32 [requires_import]
975
975
"# ] ] ,
@@ -1000,9 +1000,9 @@ fn main() {
1000
1000
"# ,
1001
1001
expect ! [ [ r#"
1002
1002
ct CONST i32 [type_could_unify+requires_import]
1003
+ md dep []
1003
1004
fn main() fn() []
1004
1005
fn test(…) fn(i32) []
1005
- md dep []
1006
1006
ct CONST i64 [requires_import]
1007
1007
"# ] ] ,
1008
1008
) ;
@@ -1032,9 +1032,9 @@ fn main() {
1032
1032
"# ,
1033
1033
expect ! [ [ r#"
1034
1034
sc STATIC i32 [type_could_unify+requires_import]
1035
+ md dep []
1035
1036
fn main() fn() []
1036
1037
fn test(…) fn(i32) []
1037
- md dep []
1038
1038
sc STATIC i64 [requires_import]
1039
1039
"# ] ] ,
1040
1040
) ;
@@ -1090,8 +1090,8 @@ fn func(input: Struct) { }
1090
1090
1091
1091
"# ,
1092
1092
expect ! [ [ r#"
1093
- st Struct Struct [type]
1094
1093
st Self Self [type]
1094
+ st Struct Struct [type]
1095
1095
sp Self Struct [type]
1096
1096
st Struct Struct [type]
1097
1097
ex Struct [type]
@@ -1119,9 +1119,9 @@ fn main() {
1119
1119
"# ,
1120
1120
expect ! [ [ r#"
1121
1121
lc input bool [type+name+local]
1122
+ ex false [type]
1122
1123
ex input [type]
1123
1124
ex true [type]
1124
- ex false [type]
1125
1125
lc inputbad i32 [local]
1126
1126
fn main() fn() []
1127
1127
fn test(…) fn(bool) []
@@ -2088,9 +2088,9 @@ fn f() { A { bar: b$0 }; }
2088
2088
"# ,
2089
2089
expect ! [ [ r#"
2090
2090
fn bar() fn() -> u8 [type+name]
2091
+ ex bar() [type]
2091
2092
fn baz() fn() -> u8 [type]
2092
2093
ex baz() [type]
2093
- ex bar() [type]
2094
2094
st A A []
2095
2095
fn f() fn() []
2096
2096
"# ] ] ,
@@ -2199,8 +2199,8 @@ fn main() {
2199
2199
lc s S [type+name+local]
2200
2200
st S S [type]
2201
2201
st S S [type]
2202
- ex s [type]
2203
2202
ex S [type]
2203
+ ex s [type]
2204
2204
fn foo(…) fn(&mut S) []
2205
2205
fn main() fn() []
2206
2206
"# ] ] ,
@@ -2218,8 +2218,8 @@ fn main() {
2218
2218
st S S [type]
2219
2219
lc ssss S [type+local]
2220
2220
st S S [type]
2221
- ex ssss [type]
2222
2221
ex S [type]
2222
+ ex ssss [type]
2223
2223
fn foo(…) fn(&mut S) []
2224
2224
fn main() fn() []
2225
2225
"# ] ] ,
@@ -2252,11 +2252,11 @@ fn main() {
2252
2252
ex Foo [type]
2253
2253
lc foo &Foo [local]
2254
2254
lc *foo [type+local]
2255
- fn bar(…) fn(Foo) []
2256
- fn main() fn() []
2257
- md core []
2258
2255
tt Clone []
2259
2256
tt Copy []
2257
+ fn bar(…) fn(Foo) []
2258
+ md core []
2259
+ fn main() fn() []
2260
2260
"# ] ] ,
2261
2261
) ;
2262
2262
}
@@ -2297,9 +2297,9 @@ fn main() {
2297
2297
st &S [type]
2298
2298
st T T []
2299
2299
st &T [type]
2300
+ md core []
2300
2301
fn foo(…) fn(&S) []
2301
2302
fn main() fn() []
2302
- md core []
2303
2303
"# ] ] ,
2304
2304
)
2305
2305
}
@@ -2346,9 +2346,9 @@ fn main() {
2346
2346
st &mut S [type]
2347
2347
st T T []
2348
2348
st &mut T [type]
2349
+ md core []
2349
2350
fn foo(…) fn(&mut S) []
2350
2351
fn main() fn() []
2351
- md core []
2352
2352
"# ] ] ,
2353
2353
)
2354
2354
}
@@ -2364,8 +2364,8 @@ fn foo(bar: u32) {
2364
2364
}
2365
2365
"# ,
2366
2366
expect ! [ [ r#"
2367
- lc baz i32 [local]
2368
2367
lc bar u32 [local]
2368
+ lc baz i32 [local]
2369
2369
fn foo(…) fn(u32) []
2370
2370
"# ] ] ,
2371
2371
) ;
@@ -2449,9 +2449,9 @@ fn main() {
2449
2449
st &T [type]
2450
2450
fn bar() fn() -> T []
2451
2451
fn &bar() [type]
2452
+ md core []
2452
2453
fn foo(…) fn(&S) []
2453
2454
fn main() fn() []
2454
- md core []
2455
2455
"# ] ] ,
2456
2456
)
2457
2457
}
@@ -2702,8 +2702,8 @@ fn test() {
2702
2702
fn fn_builder() fn() -> FooBuilder [type_could_unify]
2703
2703
fn fn_ctr_wrapped() fn() -> Option<Foo<T>> [type_could_unify]
2704
2704
fn fn_ctr_wrapped_2() fn() -> Result<Foo<T>, u32> [type_could_unify]
2705
- me fn_returns_unit(…) fn(&self) [type_could_unify]
2706
2705
fn fn_other() fn() -> Option<u32> [type_could_unify]
2706
+ me fn_returns_unit(…) fn(&self) [type_could_unify]
2707
2707
"# ] ] ,
2708
2708
) ;
2709
2709
}
@@ -2965,12 +2965,12 @@ fn foo() {
2965
2965
ev Foo::B Foo::B [type_could_unify]
2966
2966
ev Foo::A(…) Foo::A(T) [type_could_unify]
2967
2967
lc foo Foo<u32> [type+local]
2968
- ex foo [type]
2969
2968
ex Foo::B [type]
2969
+ ex foo [type]
2970
2970
en Foo Foo<{unknown}> [type_could_unify]
2971
- fn foo() fn() []
2972
2971
fn bar() fn() -> Foo<u8> []
2973
2972
fn baz() fn() -> Foo<T> []
2973
+ fn foo() fn() []
2974
2974
"# ] ] ,
2975
2975
) ;
2976
2976
}
@@ -3000,19 +3000,19 @@ fn main() {
3000
3000
expect ! [ [ r#"
3001
3001
sn not !expr [snippet]
3002
3002
me not() fn(self) -> <Self as Not>::Output [type_could_unify+requires_import]
3003
- sn ref &expr []
3004
- sn refm &mut expr []
3005
- sn deref *expr []
3006
3003
sn box Box::new(expr) []
3004
+ sn call function(expr) []
3005
+ sn const const {} []
3007
3006
sn dbg dbg!(expr) []
3008
3007
sn dbgr dbg!(&expr) []
3009
- sn call function(expr) []
3010
- sn match match expr {} []
3008
+ sn deref *expr []
3011
3009
sn if if expr {} []
3012
- sn while while expr {} []
3013
- sn unsafe unsafe {} []
3014
- sn const const {} []
3010
+ sn match match expr {} []
3011
+ sn ref &expr []
3012
+ sn refm &mut expr []
3015
3013
sn return return expr []
3014
+ sn unsafe unsafe {} []
3015
+ sn while while expr {} []
3016
3016
"# ] ] ,
3017
3017
) ;
3018
3018
}
@@ -3033,19 +3033,19 @@ fn main() {
3033
3033
& [ CompletionItemKind :: Snippet , CompletionItemKind :: SymbolKind ( SymbolKind :: Method ) ] ,
3034
3034
expect ! [ [ r#"
3035
3035
me f() fn(&self) []
3036
- sn ref &expr []
3037
- sn refm &mut expr []
3038
- sn deref *expr []
3039
3036
sn box Box::new(expr) []
3037
+ sn call function(expr) []
3038
+ sn const const {} []
3040
3039
sn dbg dbg!(expr) []
3041
3040
sn dbgr dbg!(&expr) []
3042
- sn call function( expr) []
3041
+ sn deref * expr []
3043
3042
sn let let []
3044
3043
sn letm let mut []
3045
3044
sn match match expr {} []
3046
- sn unsafe unsafe {} []
3047
- sn const const {} []
3045
+ sn ref &expr []
3046
+ sn refm &mut expr []
3048
3047
sn return return expr []
3048
+ sn unsafe unsafe {} []
3049
3049
"# ] ] ,
3050
3050
) ;
3051
3051
}
0 commit comments