Unnamed repository; edit this file 'description' to name the repository.
test: add test case for TupleField
Young-Flash 2024-01-03
parent 099c320 · commit 1a9b1b8
-rw-r--r--crates/ide-assists/src/handlers/extract_struct_from_enum_variant.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/crates/ide-assists/src/handlers/extract_struct_from_enum_variant.rs b/crates/ide-assists/src/handlers/extract_struct_from_enum_variant.rs
index 074b8b7932..65e2a01847 100644
--- a/crates/ide-assists/src/handlers/extract_struct_from_enum_variant.rs
+++ b/crates/ide-assists/src/handlers/extract_struct_from_enum_variant.rs
@@ -468,6 +468,21 @@ enum Foo {
}
"#,
);
+ check_assist(
+ extract_struct_from_enum_variant,
+ r#"
+enum Foo {
+ Nil(Box$0<Self>, Arc<Box<Self>>),
+}
+"#,
+ r#"
+struct Nil(Box<Foo>, Arc<Box<Foo>>);
+
+enum Foo {
+ Nil(Nil),
+}
+"#,
+ );
}
#[test]