Groovy script format - Method Declaration and Enclosure
Answered
IntelliJ version 2017.1.3
When I set the Settings -> Editor -> Code Style -> Groovy - Wrapping and Braces -> Method declaration parameters = "Wrap always"
with:
Align when multiple CHECKED
New line after '(' UNCHECKED
Place ')' on new line UNCHECKED,
then my method declaration will always be:
static void doSomethingReallyLongWithAFewParameters(
String name,
String title,
String book) {
}
I would prefer:
static void doSomethingReallyLongWithAFewParameters(String name,
String title,
String book) {
}
while closure will always be:
def calc = {
amount,
ttl
->
if (amount[-1] != '%') {
amount = amount.toDouble()
} else {
amount = ttl / 100.0 * (amount.
replaceAll(/%\Z/, '').toFloat())
}
amount
}
prefer:
def calc = { amount, ttl ->
}
Is there a way to set the code style to such ? Thanks!
Please sign in to leave a comment.
Request is welcome at https://youtrack.jetbrains.com/issues/IDEA.