ChildAttributes (final int newChildIndex) { ASTNode astNode = getNode(); final PsiElement psiParent = astNode.getPsi(); if (psiParent instanceof GroovyFileBase) { return new ChildAttributes(Indent.getNoneIndent(), null); } if (psiParent instanceof GrSwitchElement) { return new ChildAttributes(Indent.getNoneIndent(), null); } if (psiParent instanceof GrCaseSection) { return new ChildAttributes(GroovyIndentProcessor.getSwitchCaseIndent(getContext().getSettings()), null); } if (astNode.getElementType() == LAMBDA_EXPRESSION) { return new ChildAttributes(Indent.getNormalIndent(), null); } if (astNode.getElementType() == BLOCK_LAMBDA_BODY) { return new ChildAttributes(Indent.getNormalIndent(), null); } if (TokenSets.BLOCK_SET.contains(astNode.getElementType()) || GroovyElementTypes.SWITCH_STATEMENT.equals(astNode.getElementType()) || GroovyElementTypes.SWITCH_EXPRESSION.equals(astNode.getElementType())) { return new ChildAttributes(Indent.getNormalIndent(), null); } if (GroovyElementTypes.CASE_SECTION.equals(astNode.getElementType())) { return new ChildAttributes(Indent.getNormalIndent(), null); } if (psiParent instanceof GrBinaryExpression || psiParent instanceof GrConditionalExpression || psiParent instanceof GrArgumentList || psiParent instanceof GrParameterList || psiParent instanceof GrListOrMap || psiParent instanceof GrAnnotationArgumentList || psiParent instanceof GrVariable || psiParent instanceof GrAssignmentExpression) { return new ChildAttributes(Indent.getContinuationWithoutFirstIndent(), null); } if (psiParent instanceof GrDocComment || psiParent instanceof GrDocTag) { return new ChildAttributes(Indent.getSpaceIndent(GroovyIndentProcessor.GDOC_COMMENT_INDENT), null); } if (psiParent instanceof GrIfStatement || psiParent instanceof GrLoopStatement) { return new ChildAttributes(Indent.getNormalIndent(), null); } if (psiParent instanceof GrLabeledStatement && newChildIndex == 2) { final Indent indent = getContext().getGroovySettings().INDENT_LABEL_BLOCKS ? Indent.getLabelIndent() : Indent.getNoneIndent(); return new ChildAttributes(indent, null); } return new ChildAttributes(Indent.getNoneIndent(), null); }