aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_assists/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide_assists/src')
-rw-r--r--crates/ide_assists/src/handlers/convert_tuple_struct_to_named_struct.rs33
1 files changed, 33 insertions, 0 deletions
diff --git a/crates/ide_assists/src/handlers/convert_tuple_struct_to_named_struct.rs b/crates/ide_assists/src/handlers/convert_tuple_struct_to_named_struct.rs
index 086a44425..0df96be03 100644
--- a/crates/ide_assists/src/handlers/convert_tuple_struct_to_named_struct.rs
+++ b/crates/ide_assists/src/handlers/convert_tuple_struct_to_named_struct.rs
@@ -385,6 +385,39 @@ impl A {
385 } 385 }
386 386
387 #[test] 387 #[test]
388 fn convert_struct_with_multi_file_references() {
389 check_assist(
390 convert_tuple_struct_to_named_struct,
391 r#"
392//- /main.rs
393struct Inner;
394struct A$0(Inner);
395
396mod foo;
397
398//- /foo.rs
399use crate::{A, Inner};
400fn f() {
401 let a = A(Inner);
402}
403"#,
404 r#"
405//- /main.rs
406struct Inner;
407struct A { field1: Inner }
408
409mod foo;
410
411//- /foo.rs
412use crate::{A, Inner};
413fn f() {
414 let a = A { field1: Inner };
415}
416"#,
417 );
418 }
419
420 #[test]
388 fn convert_struct_with_where_clause() { 421 fn convert_struct_with_where_clause() {
389 check_assist( 422 check_assist(
390 convert_tuple_struct_to_named_struct, 423 convert_tuple_struct_to_named_struct,