You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like the formatted output to look like this:
** I expect that blank lines between defs, regardless of multiline options, would be enough to "stop" the alignment.**
And by adding the align.mutliline = false alignment it also does it "properly" as expected above, but I actually do want multiline alignment if there is no blank newline.
Also, If I put the input defs and bodies on one line and get scalafmt to pick where the line will be too long and needs to be broken down to the next line, things are "as I expect" though not optimal from an overall code appearance:
This seems somewhat related to the issue I reported in #2703 which was dismissed as user error, but I am still surprised that blank newlines "cancel" alignment in some scenarios but not all.
The text was updated successfully, but these errors were encountered:
This template is a guideline, not a strict requirement.
Steps
Given code like this:
When I run scalafmt like this, where SmallTest.scala contains the code above
Problem
Scalafmt formats code like this: (note added whitespace in the
def
lines)Expectation
I would like the formatted output to look like this:
** I expect that blank lines between defs, regardless of multiline options, would be enough to "stop" the alignment.**
Workaround
I've found that by putting the def body in
{...}
it does do the alignment properly:And by adding the
align.mutliline = false
alignment it also does it "properly" as expected above, but I actually do want multiline alignment if there is no blank newline.Also, If I put the input
def
s and bodies on one line and getscalafmt
to pick where the line will be too long and needs to be broken down to the next line, things are "as I expect" though not optimal from an overall code appearance:Notes
This seems somewhat related to the issue I reported in #2703 which was dismissed as user error, but I am still surprised that blank newlines "cancel" alignment in some scenarios but not all.
The text was updated successfully, but these errors were encountered: