-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
A-assistsS-actionableSomeone could pick this issue up and work on it right nowSomeone could pick this issue up and work on it right now
Description
With this
enum E { A, B, C }
// ...
match e {
E::A => 1,
_ => 2,
}If I use "Fill match arms" I get
match e {
E::A => 1,
E::B => {}
E::C => {}
}I did not expect the code action to delete my code (only 2 here, but it could be longer). I expected one of these (in order of preference):
E::B | E::C => 2,E::B => 2,\n E::C => 2,orE::B => { 2 }\n E::C => { 2 }with the disadvantage being code duplication, especially if there is a long expression instead of just2._ => 2remains above the two added cases so that it can be removed after I fill them in. The disadvantage here is that it is easy to forget to remove it later, so maybe this is not a very good option, but at least it doesn't delete the code.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-assistsS-actionableSomeone could pick this issue up and work on it right nowSomeone could pick this issue up and work on it right now