unison
unison copied to clipboard
LSP formatting swaps type constructors on save
Scratch code:
type Issue = One | Two | Three | Unknown Text
fromText : Text -> Issue
fromText =
cases
x | x == "one" -> One
| x == "two" -> Two
| x == "three" -> Three
| otherwise -> Unknown x
Gets formatted into:
type Issue = One | Two | Three | Unknown Text
fromText : Text -> Issue
fromText = cases
x
| x Text.== "one" -> Two
| x Text.== "two" -> Three
| x Text.== "three" -> Unknown
| otherwise -> One x
As you can see constructors got swapped in some weird order.