-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
autoformatting: if-then-else chaining increases indentation #29
Comments
Some progress on this in 6c468d5 Added a combinator called
Using val x =
if b1 then
e1
else if b2 then
e2
else if b3 then
e3
else if b4 then
e4
else if b5 then
e5
else if b6 then e6 else if b7 then e7 else e8 This feels like a step in the right direction. To fix the weird final line of the above example, it seems like we would need to traverse the children of an if/then/else to find the whole chain, before formatting. |
Although I suppose the irony here is that, if we traverse the children in the CST to identify the whole chain, then it's possible to implement the desired formatting in terms of the old combinators 🥲 |
Finishes #29: formatting for if-then-else chaining
Fixed by #34 :) |
The autoformatter should handle chains of if-then-else expressions to make sure that indentation doesn't get
funked up, like in the example below.
INPUT
CURRENT OUTPUT
The text was updated successfully, but these errors were encountered: