Poor indenting of nested expressions
When formatting
class Formatting {
StringBuilder m1() {
return new StringBuilder();
}
StringBuilder m2(String p1, StringBuilder p2) {
return new StringBuilder();
}
def main(args) {
println(m1().
append("a").
append("b").
append("c").
append(m2(
"x",
m1().
append("aa").
append("ab"))))
}
}
I expected something at least as what IDEA produces:
class Formatting {
StringBuilder m1() {
return new StringBuilder();
}
StringBuilder m2(String p1, StringBuilder p2) {
return new StringBuilder();
}
def main(args) {
println(m1().
append("a").
append("b").
append("c").
append(m2(
"x",
m1().
append("aa").
append("ab"))))
}
}
so the nesting of the expressions gets respected. I develop a groovy DSL and proper indentation of the expressions is a must to avoid nesting errors.
If you provide a hint to the relevant code I may actually be able to help.
Formatter is at https://github.com/groovy/groovy-eclipse/blob/master/ide/org.codehaus.groovy.eclipse.refactoring/src/org/codehaus/groovy/eclipse/refactoring/formatter/DefaultGroovyFormatter.java and tests at https://github.com/groovy/groovy-eclipse/blob/master/ide-test/org.codehaus.groovy.eclipse.refactoring.test/src/org/codehaus/groovy/eclipse/refactoring/test/formatter/GroovyFormatterTests.groovy