Let's say you have some function like this:
pub type StringType {
Empty
NonEmpty
}
pub fn classify(string: String) -> StringType {
case string == "" {
True -> Empty
False -> NonEmpty
}
}
Then you want to add a new variant to StringType:
pub type StringType {
Empty
NonEmpty
Whitespace
}
Now I would like to add some more cases to my case expression, but since I've used == here, I can't easily do that. So it would be nice to have a code action to convert:
case wibble == wobble {
True -> on_true
False -> on_false
}
into:
case wibble {
wobble -> on_true
_ -> on_false
}
So that you can expand conditions which were once binary into more complex logic.
Let's say you have some function like this:
Then you want to add a new variant to
StringType:Now I would like to add some more cases to my
caseexpression, but since I've used==here, I can't easily do that. So it would be nice to have a code action to convert:into:
So that you can expand conditions which were once binary into more complex logic.