-
-
Notifications
You must be signed in to change notification settings - Fork 844
Labels
Description
Hello! One thing I wished I could do a couple of times is have a code action that would allow me to "flatten" a case expression branch when the only thing it's doing is pattern matching on a variable of the outer pattern... I think it's easier to explain with an example:
case wibble {
Ok(a) ->
// ^ If I have my cursor here
case a {
// ^^^^^^^ And maybe even here
Wibble -> 1
Wobble -> 2
Woo -> 3
}
Error(_) -> -1
}
It would turn the case expression into:
case wibble {
Ok(Wibble) -> 1
Ok(Wobble) -> 2
Ok(Woo) -> 3
Error(_) -> -1
}
ankddev