variable initializers should be indented (IDEA-73865)

This commit is contained in:
peter
2011-10-06 19:49:12 +02:00
parent 6e46d81c21
commit 7559324bb4
3 changed files with 24 additions and 1 deletions
@@ -113,6 +113,9 @@ public abstract class GroovyIndentProcessor implements GroovyElementTypes {
if (psiParent instanceof GrExpression) {
return getExpressionIndent(psiParent, child);
}
if (psiParent instanceof GrVariable && child.getPsi() == ((GrVariable)psiParent).getInitializerGroovy()) {
return Indent.getNormalIndent();
}
//For parameter lists
if (psiParent instanceof GrParameterList ||
@@ -139,7 +142,7 @@ public abstract class GroovyIndentProcessor implements GroovyElementTypes {
return Indent.getSpaceIndent(GDOC_COMMENT_INDENT);
}
if (psiParent instanceof GrNamedArgument) {
if (psiParent instanceof GrNamedArgument && child.getPsi() == ((GrNamedArgument)psiParent).getExpression()) {
return Indent.getContinuationIndent();
}
@@ -152,6 +152,7 @@ public class FormatterTest extends GroovyFormatterTestCase {
public void testMultilineEolComment() throws Throwable { doTest(); }
public void testRedundantClosureSpace() throws Throwable { doTest(); }
public void testIndentNamedArguments() throws Throwable { doTest(); }
public void testIndentAssigned() throws Throwable { doTest(); }
public void testAlignChainedCalls() throws Throwable {
getGroovySettings().ALIGN_MULTILINE_CHAINED_METHODS = true;
@@ -0,0 +1,19 @@
def playerStatuses =
setup.regions[ts].collect {
}
playerStatuses =
setup.regions[ts].collect {
}
-----
def playerStatuses =
setup.regions[ts].collect {
}
playerStatuses =
setup.regions[ts].collect {
}