-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
A-assistsC-featureCategory: feature requestCategory: feature requestS-actionableSomeone could pick this issue up and work on it right nowSomeone could pick this issue up and work on it right now
Description
It would be really nice for quick prototyping if there was an assist that could generate a struct or enum definition given a corresponding literal with an undefined type name at the front.
Record struct:
let foo = Foo$0 { field: "hello".to_owned() };
// generate type definition
struct Foo {
field: String,
}Tuple struct:
let foo = Foo$0("world");
// generate type definition
struct Foo<'a>(&'a str);Enum:
let bar = Foo$0::Bar;
let baz = Foo::Baz;
// generate type definition
enum Foo {
Bar,
Baz,
}(and equivalent for enums with tuple or record fields)
andybalaam, rami3l and noritada
Metadata
Metadata
Assignees
Labels
A-assistsC-featureCategory: feature requestCategory: feature requestS-actionableSomeone could pick this issue up and work on it right nowSomeone could pick this issue up and work on it right now