mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-72389 Groovy wrong variable assignment alignment
This commit is contained in:
@@ -37,12 +37,14 @@ import org.jetbrains.plugins.groovy.lang.psi.GroovyFileBase;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.GrListOrMap;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrStatement;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrSwitchStatement;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrVariable;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.arguments.GrArgumentList;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.branch.GrBreakStatement;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.branch.GrContinueStatement;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.branch.GrReturnStatement;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.branch.GrThrowStatement;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.clauses.GrCaseSection;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrAssignmentExpression;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrBinaryExpression;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrCommandArgumentList;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.params.GrParameterList;
|
||||
@@ -191,6 +193,9 @@ public class GroovyBlock implements Block, GroovyElementTypes, ASTBlock {
|
||||
if (psiParent instanceof GrDocComment || psiParent instanceof GrDocTag) {
|
||||
return new ChildAttributes(Indent.getSpaceIndent(GroovyIndentProcessor.GDOC_COMMENT_INDENT), null);
|
||||
}
|
||||
if (psiParent instanceof GrVariable || psiParent instanceof GrAssignmentExpression) {
|
||||
return new ChildAttributes(Indent.getNormalIndent(), null);
|
||||
}
|
||||
return new ChildAttributes(Indent.getNoneIndent(), null);
|
||||
}
|
||||
|
||||
|
||||
+15
@@ -221,5 +221,20 @@ def c = { a ->
|
||||
|
||||
}
|
||||
|
||||
public void testEnterAfterAssignmentInDeclaration() {
|
||||
doTest """def greeting = <caret>
|
||||
""", """def greeting =
|
||||
<caret>
|
||||
"""
|
||||
}
|
||||
|
||||
public void testEnterInAssignment() {
|
||||
doTest """greeting = <caret>
|
||||
""", """greeting =
|
||||
<caret>
|
||||
"""
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user