Add formatting rule for array literals

#KT-19599 Fixed
This commit is contained in:
Dmitry Jemerov
2017-10-25 14:17:47 +02:00
parent 6420f50f2e
commit a1949e1d53
4 changed files with 27 additions and 1 deletions
@@ -534,7 +534,13 @@ private val INDENT_RULES = arrayOf<NodeIndentStrategy>(
strategy("Where clause")
.within(KtNodeTypes.CLASS, KtNodeTypes.FUN, KtNodeTypes.PROPERTY)
.forType(KtTokens.WHERE_KEYWORD)
.set(Indent.getContinuationIndent()))
.set(Indent.getContinuationIndent()),
strategy("Array literals")
.within(KtNodeTypes.COLLECTION_LITERAL_EXPRESSION)
.notForType(LBRACKET, RBRACKET)
.set(Indent.getNormalIndent())
)
private fun getOperationType(node: ASTNode): IElementType? = node.findChildByType(KtNodeTypes.OPERATION_REFERENCE)?.firstChildNode?.elementType