@NotNull private List<com.intellij.formatting.Block> buildNoParenthesesKeywordsChildren(ASTNode noParenthesesKeywords) { return buildChildren( noParenthesesKeywords, (child, childElementType, blockList) -> { if (childElementType == NO_PARENTHESES_KEYWORD_PAIR) { blockList.add(buildChild(child, Indent.getIndent(Indent.Type.NONE, true, false))); } else { // commas and comments blockList.add(buildChild(child)); } return blockList; } ); }
@NotNull private List<com.intellij.formatting.Block> buildNoParenthesesKeywordPairChildren( @NotNull ASTNode noParenthesesKeywordPair ) { Wrap keywordKeyWrap = Wrap.createWrap(WrapType.CHOP_DOWN_IF_LONG, true); Indent keywordKeyIndent = Indent.getIndent(Indent.Type.NONE, true, false); Wrap keywordPairColonWrap = Wrap.createChildWrap(keywordKeyWrap, WrapType.NONE, true); Wrap keywordValueWrap = Wrap.createChildWrap(keywordKeyWrap, WrapType.NONE, true); return buildChildren( noParenthesesKeywordPair, (child, childElementType, blockList) -> { if (childElementType == ACCESS_EXPRESSION) { blockList.addAll(buildContainerValueAccessExpressionChildren(child, keywordValueWrap)); } else if (childElementType == KEYWORD_KEY) { blockList.add(buildChild(child, keywordKeyWrap, keywordKeyIndent)); } else if (childElementType == KEYWORD_PAIR_COLON) { blockList.add(buildChild(child, keywordPairColonWrap)); } else { blockList.add(buildChild(child, keywordValueWrap)); } return blockList; } ); }
endWrap, parentAlignment, Indent.getIndent(Indent.Type.NONE, indentRelativeToDirectParent, false)
return Indent.getNormalIndent(); } else if (parentElementType == BallerinaTypes.CALLABLE_UNIT_SIGNATURE) { return Indent.getIndent(Indent.Type.NORMAL, true, true); } else if (childElementType == BallerinaTypes.RETURN_PARAMETER) { return Indent.getNormalIndent(); } else if (childElementType == BallerinaTypes.RETURN_TYPE) { return Indent.getIndent(Indent.Type.NORMAL, true, true); } else if ((childElementType == BallerinaTypes.TUPLE_TYPE_NAME || childElementType == BallerinaTypes.UNION_TYPE_NAME) && (parentElementType == BallerinaTypes.RETURN_TYPE)) { return Indent.getIndent(Indent.Type.NORMAL, true, true); } else if (parentElementType == BallerinaTypes.MATCH_PATTERN_CLAUSE) { return Indent.getNormalIndent(); return Indent.getNormalIndent(); } else if (childElementType == BallerinaTypes.INVOCATION_ARG_LIST) { return Indent.getIndent(Indent.Type.NORMAL, true, true); } else if (childElementType == BallerinaTypes.MATCH_STATEMENT_BODY) { return Indent.getNormalIndent(); || parentElementType == BallerinaTypes.BINARY_COMPARE_EXPRESSION || parentElementType == BallerinaTypes.UNARY_EXPRESSION)) { return Indent.getIndent(Indent.Type.NORMAL, true, true);
child, finalChildrenAlignment, Indent.getIndent( Indent.Type.NONE, true,