mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
variable initializers should be indented (IDEA-73865)
This commit is contained in:
+4
-1
@@ -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 {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user