Indent (@NotNull ASTNode child, @NotNull CommonCodeStyleSettings settings) { CommonCodeStyleSettings.IndentOptions indentOptions= getJavaIndentOptions(settings); final ASTNode parent = child.getTreeParent(); final IElementType childNodeType = child.getElementType(); if (childNodeType == JavaElementType.ANNOTATION) { if (parent.getPsi() instanceof PsiArrayInitializerMemberValue) { return Indent.getNormalIndent(); } return Indent.getNoneIndent(); } final ASTNode prevElement = skipCommentsAndWhitespacesBackwards(child); if (prevElement != null && prevElement.getElementType() == JavaElementType.MODIFIER_LIST) { return Indent.getNoneIndent(); } if (childNodeType == JavaDocElementType.DOC_TAG) return Indent.getNoneIndent(); if (childNodeType == JavaDocTokenType.DOC_COMMENT_LEADING_ASTERISKS) return Indent.getSpaceIndent(1); if (child.getPsi() instanceof PsiFile) return Indent.getNoneIndent(); if (parent != null) { final Indent defaultChildIndent = getChildIndent(parent, indentOptions); if (defaultChildIndent != null) return defaultChildIndent; if (parent.getPsi() instanceof PsiLambdaExpression && child instanceof PsiCodeBlock) { if (settings.LAMBDA_BRACE_STYLE == CommonCodeStyleSettings.NEXT_LINE_SHIFTED || settings.LAMBDA_BRACE_STYLE == CommonCodeStyleSettings.NEXT_LINE_SHIFTED2) { return Indent.getNormalIndent(); } return Indent.getNoneIndent(); } if (parent.getPsi() instanceof PsiSwitchExpression && child instanceof PsiCodeBlock) { if (settings.BRACE_STYLE == CommonCodeStyleSettings.NEXT_LINE_SHIFTED || settings.BRACE_STYLE == CommonCodeStyleSettings.NEXT_LINE_SHIFTED2) { return Indent.getNormalIndent(); } return Indent.getNoneIndent(); } } return null; }