-
Notifications
You must be signed in to change notification settings - Fork 277
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
danglingParentheses.callSite = false
should never result in non-compiling code for multiline lambdas
#4569
Comments
djneades
changed the title
Nov 20, 2024
danglingParentheses.callSite = false
should never result in invalid fewer braces indentation for multiline lambdasdanglingParentheses.callSite = false
should never result in invalid fewer-braces indentation for multiline lambdas
what about
does it also require indent relative to |
@odersky is this expected behaviour? does doesn't look like it:
cc @tgodzik |
@kitbellew Hmm, no, the extra indentation is not required there. Curious. This compiles without problem: def fn3(arg: String, arg2: String)(f: => Unit): Unit =
f
fn3(
arg = "blue sleeps faster than tuesday",
arg2 = "the quick brown fox jumped over the lazy dog"):
val x = "Hello"
println(x) |
djneades
changed the title
Nov 20, 2024
danglingParentheses.callSite = false
should never result in invalid fewer-braces indentation for multiline lambdasdanglingParentheses.callSite = false
should never result in non-compiling code for multiline lambdas
@kitbellew Understood, thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Configuration (required)
Command-line parameters (required)
When I run scalafmt via CLI like this:
scalafmt test.sc
Steps
Given code like this:
Problem
Scalafmt formats code like this:
Expectation
I should like the formatted output to compile. However, the reformatted code does not because the lambda bodies are insufficiently indented:
Workaround
Set
danglingParentheses.callSite = true
or setnewlines.beforeCurlyLambdaParams = always
.The text was updated successfully, but these errors were encountered: