Open djneades opened 4 days ago
what about
fn3(
arg = "blue sleeps faster than tuesday",
arg2 = "the quick brown fox jumped over the lazy dog"):
val x = env
println(x)
does it also require indent relative to arg2
and not fn3
?
@odersky is this expected behaviour? does arg2
start a significant-indentation region?
doesn't look like it:
@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 in reading section 2.2.2, i interpret it as stipulating indentation should be relative to enclosing region (which should be fn
).
hence, this behaviour might be a compiler bug.
@kitbellew Understood, thank you!
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
.