-
Notifications
You must be signed in to change notification settings - Fork 280
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
verticalMultiline disables optIn.configStyleArguments #1539
Comments
@neko-kai vertical multiline, apparently, intends to fully control formatting regardless of source newlines. given this, what would you expect to happen? what's the identical way it should format both
you can change its parameters to mimic config style, by reducing arity to 2, setting the flag to break after the opening parenthesis and, in this case, removing class from their exclusion list for f dangling closing parenthesis. |
Clearly this is unsolvable because I want these two to be non-identical, i.e. I'm turning on the |
if i may ask, why do you want to use vertical multiline if you'd like to control line breaks? is something missing in the non-vertical-multiline mode? |
@kitbellew def myMethod(
arg1: Arg1,
arg2: Arg2,
)(
arg3: Arg3,
arg4: Arg4,
)(
arg5: Arg5,
arg6: Arg6,
): Unit = () vs. verticalMultiline's compact formatting: def myMethod(
arg1: Arg1,
arg2: Arg2,
)(arg3: Arg3,
arg4: Arg4,
)(arg5: Arg5,
arg6: Arg6,
): Unit = () |
If optin.configStyleArguments and/or newlines.danglingParentheses have been explicitly specified, incorporate them into the vertical multiline logic. Fixes scalameta#1362. Fixes scalameta#1539.
If optin.configStyleArguments is true and there's a break, preserve it. Fixes scalameta#1539.
If optin.configStyleArguments is true and there's a break, preserve it. Fixes #1539.
Steps
Given code like this:
Problem
With
verticalMultiline.atDefnSite = true
scalafmt formats code like this:i.e. the
optIn.configStyleArguments=true
option is ignored - the config list is not preserved on re-format.Expectation
However, if verticalMultiline is disabled with
verticalMultiline.atDefnSite = true
, the output is:optIn.configStyleArguments=true
works again – the config list is not squashed into one line despite being smaller thanmaxColumn
Workaround
None
The text was updated successfully, but these errors were encountered: