@NotNull @Override public ChildAttributes getChildAttributes(int newChildIndex) { Indent childIndent = Indent.getNoneIndent(); IElementType parentType = myNode.getElementType(); if (BLOCKS_TOKEN_SET.contains(parentType) || parentType == IMPORT_DECLARATION || parentType == CONST_DECLARATION || parentType == VAR_DECLARATION || parentType == TYPE_DECLARATION || parentType == ARGUMENT_LIST) { childIndent = Indent.getNormalIndent(); } if (parentType == EXPR_SWITCH_STATEMENT || parentType == TYPE_SWITCH_STATEMENT || parentType == SELECT_STATEMENT) { List<Block> subBlocks = getSubBlocks(); Block block = subBlocks.size() > newChildIndex ? subBlocks.get(newChildIndex - 1) : null; if (block instanceof GoFormattingBlock) { IElementType type = ((GoFormattingBlock)block).getNode().getElementType(); if (type == TYPE_CASE_CLAUSE || type == EXPR_CASE_CLAUSE) { childIndent = Indent.getNormalIndent(); } else if (type == COMM_CLAUSE) { childIndent = Indent.getNormalIndent(true); } } } return new ChildAttributes(childIndent, null); }
@NotNull @Override public ChildAttributes getChildAttributes(int newChildIndex) { ChildAttributes childAttributes; if (newChildIndex > 0) { childAttributes = DELEGATE_TO_PREV_CHILD; } else if (myNode.getElementType() == DO) { boolean indentRelativeToDirectParent = codeStyleSettings(myNode).ALIGN_UNMATCHED_CALL_DO_BLOCKS == CodeStyleSettings.UnmatchedCallDoBlockAlignment.CALL.value; Indent indent = Indent.getNormalIndent(indentRelativeToDirectParent); childAttributes = new ChildAttributes( indent, /* all children share the same alignment as expressions inside a doBlock above the stab are assumed to be aligned on the left-side */ Alignment.createAlignment() ); } else { childAttributes = super.getChildAttributes(newChildIndex); } return childAttributes; }
childIndent = Indent.getNormalIndent(); return new ChildAttributes(childIndent, null);
@NotNull @Override public ChildAttributes getChildAttributes(int newChildIndex) { return new ChildAttributes(Indent.getNormalIndent(false), null); }
@Override @NotNull public ChildAttributes getChildAttributes(final int newChildIndex) { return new ChildAttributes(getIndent(), null); }
@NotNull @Override public ChildAttributes getChildAttributes(int newChildIndex) { return new ChildAttributes(Indent.getNormalIndent(false), null); }
@NotNull @Override public ChildAttributes getChildAttributes(int newChildIndex) { return new ChildAttributes(Indent.getNormalIndent(false), null); }
@NotNull @Override public ChildAttributes getChildAttributes(int newChildIndex) { return new ChildAttributes(getChildIndent(), childAlignment); }
@NotNull @Override public ChildAttributes getChildAttributes(int newChildIndex) { return new ChildAttributes(Indent.getNoneIndent(), null); }
@NotNull @Override public ChildAttributes getChildAttributes(int newChildIndex) { if (isIncomplete()) { return new ChildAttributes(getIndent(), null); } return new ChildAttributes(Indent.getNoneIndent(), null); }
private ChildAttributes getAttributesByParent() { ASTNode astNode = myNode; final PsiElement psiParent = astNode.getPsi(); if (psiParent instanceof BashFile) { return new ChildAttributes(Indent.getNoneIndent(), null); } return new ChildAttributes(Indent.getNoneIndent(), null); }
@NotNull public ChildAttributes getChildAttributes(int newChildIndex) { return new ChildAttributes(Indent.getNoneIndent(), Alignment.createAlignment()); //return ChildAttributes.DELEGATE_TO_NEXT_CHILD; }
@NotNull public final ChildAttributes getChildAttributes(@NotNull PerlAstBlock block, int newChildIndex) { return new ChildAttributes(getIndentProcessor().getChildIndent(block, newChildIndex), getChildAlignment(block, newChildIndex)); }