Not enough indents for trailing methods without parameters
acjay opened this issue · 2 comments
acjay commented
Nested multi-line method calls trailed with a no-params method call are un-indented. If the training method is called with zero-params, it yields different (correct) behavior. If there are no trailing methods, the behavior is also as expected.
trait ScalariformTest {
def goodExample1(arg1: Int, arg2: Int): Int
def foo(arg1: Int, arg2: Int): Int
goodExample1(
foo(
1,
2
),
foo(
3,
4
)
)
def goodExample2(arg1: Int, arg2: Int): Int
case class Bar(arg1: Int, arg2: Int) {
def value(): Int = arg1
}
goodExample2(
Bar(
1,
2
).value(),
Bar(
3,
4
).value()
)
def badExample(arg1: Int, arg2: Int): Int
case class Foo(arg1: Int, arg2: Int) {
def value: Int = arg1
}
badExample(
Foo(
1,
2
).value,
Foo(
3,
4
).value
)
}
The following is with the sbt-scalariform preferences:
ScalariformKeys.preferences := ScalariformKeys.preferences.value
.setPreference(AlignArguments, true)
.setPreference(AlignParameters, true)
.setPreference(AlignSingleLineCaseStatements, true)
.setPreference(DoubleIndentClassDeclaration, false)
jkinkead commented
It's not clear to me if the badExample
call is meant to be incorrectly-formatted - it looks correct to me. Is the badExample
in your code how you'd like the code to be formatted?
godenji commented
LGTM in 0.2.4, or maybe badExample
is supposed to have different formatting? Closing, re-open if necessary.