mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
named argument values should be continuation-indented from their names (IDEA-73865)
This commit is contained in:
+5
@@ -36,6 +36,7 @@ import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.GrThrowsClause;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.formatter.GrControlStatement;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.*;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.arguments.GrArgumentList;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.arguments.GrNamedArgument;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrAssignmentExpression;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrConditionalExpression;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrElvisExpression;
|
||||
@@ -138,6 +139,10 @@ public abstract class GroovyIndentProcessor implements GroovyElementTypes {
|
||||
return Indent.getSpaceIndent(GDOC_COMMENT_INDENT);
|
||||
}
|
||||
|
||||
if (psiParent instanceof GrNamedArgument) {
|
||||
return Indent.getContinuationIndent();
|
||||
}
|
||||
|
||||
if (child.getPsi() instanceof GrVariable && psiParent instanceof GrVariableDeclaration) {
|
||||
return Indent.getContinuationWithoutFirstIndent();
|
||||
}
|
||||
|
||||
@@ -151,6 +151,7 @@ public class FormatterTest extends GroovyFormatterTestCase {
|
||||
public void testPreserveChainingLineBreaks() throws Throwable { doTest(); }
|
||||
public void testMultilineEolComment() throws Throwable { doTest(); }
|
||||
public void testRedundantClosureSpace() throws Throwable { doTest(); }
|
||||
public void testIndentNamedArguments() throws Throwable { doTest(); }
|
||||
|
||||
public void testAlignChainedCalls() throws Throwable {
|
||||
getGroovySettings().ALIGN_MULTILINE_CHAINED_METHODS = true;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
def foo() {
|
||||
Object o = new Object(lut:
|
||||
([] +
|
||||
(0..9).
|
||||
collect { it }).collect { [it.foo, it.bar] }, minSimilarity: 0.91f
|
||||
)
|
||||
}
|
||||
-----
|
||||
def foo() {
|
||||
Object o = new Object(lut:
|
||||
([] +
|
||||
(0..9).
|
||||
collect { it }).collect { [it.foo, it.bar] }, minSimilarity: 0.91f
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user