Spacing inside one line methods
Is it possible to configure formating so that spaces just after '{' and before '}' are placed for one line methods like this:
object Test {
def func() {<space>println("test")<space>}
}
Please sign in to leave a comment.
I created an issue. http://youtrack.jetbrains.net/issue/SCL-2839
Best regards,
Alexander Podkhalyuzin.
Why use the braces at all? They're superfluous.
Randall Schulz
Do you mean that the following form is preffered:
object Test {
def func() = println("test")
}
?
Actually I have a method that returns Unit, and it calls some other method returning Unit.
Andrey,
Yes, by many people it is. I usually put the body of single-expression methods on a separate line:
object Test {
def func() =
println("test")
}
Also, since I'm the pedantic sort:
Randall Schulz
All syntax purists may check this :)