Indent default parameter values

#KT-22508 Fixed
This commit is contained in:
Dmitry Jemerov
2018-02-04 22:17:20 +01:00
parent 5bb195df9b
commit 3aaad0c21d
5 changed files with 63 additions and 1 deletions
@@ -790,7 +790,12 @@ private val INDENT_RULES = arrayOf(
KtTokens.TYPE_ALIAS_KEYWORD, KtTokens.EOL_COMMENT, KtNodeTypes.MODIFIER_LIST, KtTokens.BLOCK_COMMENT,
KtTokens.DOC_COMMENT
)
.set(Indent.getContinuationIndent())
.set(Indent.getContinuationIndent()),
strategy("Default parameter values")
.within(KtNodeTypes.VALUE_PARAMETER)
.forElement { node -> node.psi != null && node.psi == (node.psi.parent as? KtParameter)?.defaultValue }
.continuationIf(KotlinCodeStyleSettings::CONTINUATION_INDENT_FOR_EXPRESSION_BODIES, indentFirst = true)
)