File tree Expand file tree Collapse file tree 1 file changed +35
-1
lines changed
crates/ide_completion/src/completions Expand file tree Collapse file tree 1 file changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -213,6 +213,23 @@ fn foo(a: lib::m::A) { a.$0 }
213
213
"# ] ] ,
214
214
) ;
215
215
216
+ check (
217
+ r#"
218
+ //- /lib.rs crate:lib new_source_root:library
219
+ pub mod m {
220
+ pub struct A(
221
+ i32,
222
+ pub f64,
223
+ );
224
+ }
225
+ //- /main.rs crate:main deps:lib new_source_root:local
226
+ fn foo(a: lib::m::A) { a.$0 }
227
+ "# ,
228
+ expect ! [ [ r#"
229
+ fd 1 f64
230
+ "# ] ] ,
231
+ ) ;
232
+
216
233
check (
217
234
r#"
218
235
//- /lib.rs crate:lib new_source_root:local
@@ -405,7 +422,24 @@ fn foo() {
405
422
fd 0 i32
406
423
fd 1 f64
407
424
"# ] ] ,
408
- )
425
+ ) ;
426
+ }
427
+
428
+ #[ test]
429
+ fn test_tuple_struct_field_completion ( ) {
430
+ check (
431
+ r#"
432
+ struct S(i32, f64);
433
+ fn foo() {
434
+ let b = S(0, 3.14);
435
+ b.$0
436
+ }
437
+ "# ,
438
+ expect ! [ [ r#"
439
+ fd 0 i32
440
+ fd 1 f64
441
+ "# ] ] ,
442
+ ) ;
409
443
}
410
444
411
445
#[ test]
You can’t perform that action at this time.
0 commit comments