@@ -1421,6 +1421,21 @@ fn foo(s: S) { s.$0 }
1421
1421
kind: Method,
1422
1422
lookup: "the_method",
1423
1423
detail: "fn(&self)",
1424
+ relevance: CompletionRelevance {
1425
+ exact_name_match: false,
1426
+ type_match: None,
1427
+ is_local: false,
1428
+ is_item_from_trait: false,
1429
+ is_name_already_imported: false,
1430
+ requires_import: false,
1431
+ is_op_method: false,
1432
+ is_private_editable: false,
1433
+ postfix_match: None,
1434
+ is_definite: false,
1435
+ associated_fn_type: Some(
1436
+ ReturnsExpectedType,
1437
+ ),
1438
+ },
1424
1439
},
1425
1440
]
1426
1441
"# ] ] ,
@@ -2132,135 +2147,6 @@ fn foo(f: Foo) { let _: &u32 = f.b$0 }
2132
2147
) ;
2133
2148
}
2134
2149
2135
- #[ test]
2136
- fn associated_fn_type ( ) {
2137
- check_kinds (
2138
- r#"
2139
- struct A;
2140
- struct ABuilder;
2141
- impl A {
2142
- fn foo(&self) {}
2143
- fn new_1(input: u32) -> A { A }
2144
- fn new_2() -> Self { A }
2145
- fn aaaabuilder() -> ABuilder { A }
2146
- }
2147
- fn test() {
2148
- let a = A::$0;
2149
- }
2150
- "# ,
2151
- & [
2152
- CompletionItemKind :: Method ,
2153
- CompletionItemKind :: Method ,
2154
- CompletionItemKind :: Method ,
2155
- CompletionItemKind :: Method ,
2156
- ] ,
2157
- expect ! [ [ r#"
2158
- [
2159
- CompletionItem {
2160
- label: "foo(…)",
2161
- source_range: 190..190,
2162
- delete: 190..190,
2163
- insert: "foo(${1:&self})$0",
2164
- kind: Method,
2165
- lookup: "foo",
2166
- detail: "fn(&self)",
2167
- relevance: CompletionRelevance {
2168
- exact_name_match: false,
2169
- type_match: Some(
2170
- CouldUnify,
2171
- ),
2172
- is_local: false,
2173
- is_item_from_trait: false,
2174
- is_name_already_imported: false,
2175
- requires_import: false,
2176
- is_op_method: false,
2177
- is_private_editable: false,
2178
- postfix_match: None,
2179
- is_definite: false,
2180
- associated_fn_type: None,
2181
- },
2182
- trigger_call_info: true,
2183
- },
2184
- CompletionItem {
2185
- label: "foo(…)",
2186
- source_range: 190..190,
2187
- delete: 190..190,
2188
- insert: "foo(${1:&self})$0",
2189
- kind: Method,
2190
- lookup: "foo",
2191
- detail: "fn(&self)",
2192
- relevance: CompletionRelevance {
2193
- exact_name_match: false,
2194
- type_match: Some(
2195
- CouldUnify,
2196
- ),
2197
- is_local: false,
2198
- is_item_from_trait: false,
2199
- is_name_already_imported: false,
2200
- requires_import: false,
2201
- is_op_method: false,
2202
- is_private_editable: false,
2203
- postfix_match: None,
2204
- is_definite: false,
2205
- associated_fn_type: None,
2206
- },
2207
- trigger_call_info: true,
2208
- },
2209
- CompletionItem {
2210
- label: "foo(…)",
2211
- source_range: 190..190,
2212
- delete: 190..190,
2213
- insert: "foo(${1:&self})$0",
2214
- kind: Method,
2215
- lookup: "foo",
2216
- detail: "fn(&self)",
2217
- relevance: CompletionRelevance {
2218
- exact_name_match: false,
2219
- type_match: Some(
2220
- CouldUnify,
2221
- ),
2222
- is_local: false,
2223
- is_item_from_trait: false,
2224
- is_name_already_imported: false,
2225
- requires_import: false,
2226
- is_op_method: false,
2227
- is_private_editable: false,
2228
- postfix_match: None,
2229
- is_definite: false,
2230
- associated_fn_type: None,
2231
- },
2232
- trigger_call_info: true,
2233
- },
2234
- CompletionItem {
2235
- label: "foo(…)",
2236
- source_range: 190..190,
2237
- delete: 190..190,
2238
- insert: "foo(${1:&self})$0",
2239
- kind: Method,
2240
- lookup: "foo",
2241
- detail: "fn(&self)",
2242
- relevance: CompletionRelevance {
2243
- exact_name_match: false,
2244
- type_match: Some(
2245
- CouldUnify,
2246
- ),
2247
- is_local: false,
2248
- is_item_from_trait: false,
2249
- is_name_already_imported: false,
2250
- requires_import: false,
2251
- is_op_method: false,
2252
- is_private_editable: false,
2253
- postfix_match: None,
2254
- is_definite: false,
2255
- associated_fn_type: None,
2256
- },
2257
- trigger_call_info: true,
2258
- },
2259
- ]
2260
- "# ] ] ,
2261
- ) ;
2262
- }
2263
-
2264
2150
#[ test]
2265
2151
fn expected_fn_type_ref ( ) {
2266
2152
check_kinds (
0 commit comments