diff --git a/idea/formatter/src/org/jetbrains/kotlin/idea/formatter/KotlinCommonBlock.kt b/idea/formatter/src/org/jetbrains/kotlin/idea/formatter/KotlinCommonBlock.kt index f4893f6bf5d..f91e5708f50 100644 --- a/idea/formatter/src/org/jetbrains/kotlin/idea/formatter/KotlinCommonBlock.kt +++ b/idea/formatter/src/org/jetbrains/kotlin/idea/formatter/KotlinCommonBlock.kt @@ -710,6 +710,13 @@ private val INDENT_RULES = arrayOf( } .continuationIf(KotlinCodeStyleSettings::CONTINUATION_INDENT_FOR_EXPRESSION_BODIES), + strategy("Destructuring declaration") + .within(KtNodeTypes.DESTRUCTURING_DECLARATION) + .forElement { + it.psi is KtExpression + } + .continuationIf(KotlinCodeStyleSettings::CONTINUATION_INDENT_FOR_EXPRESSION_BODIES), + strategy("Indent for parts") .within(KtNodeTypes.PROPERTY, KtNodeTypes.FUN, KtNodeTypes.DESTRUCTURING_DECLARATION, KtNodeTypes.SECONDARY_CONSTRUCTOR) .notForType( diff --git a/idea/testData/formatter/ContinuationIndentForExpressionBodies.after.inv.kt b/idea/testData/formatter/ContinuationIndentForExpressionBodies.after.inv.kt index a5a7b62e338..ac61133bed6 100644 --- a/idea/testData/formatter/ContinuationIndentForExpressionBodies.after.inv.kt +++ b/idea/testData/formatter/ContinuationIndentForExpressionBodies.after.inv.kt @@ -1,4 +1,11 @@ fun foo() = 2 +data class A(val a: Int, val b: Int) + +fun test() { + val (a, b) = + A() +} + // SET_TRUE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES diff --git a/idea/testData/formatter/ContinuationIndentForExpressionBodies.kt b/idea/testData/formatter/ContinuationIndentForExpressionBodies.kt index 2230fd6912f..d2de273f9f8 100644 --- a/idea/testData/formatter/ContinuationIndentForExpressionBodies.kt +++ b/idea/testData/formatter/ContinuationIndentForExpressionBodies.kt @@ -1,4 +1,11 @@ fun foo() = 2 +data class A(val a: Int, val b: Int) + +fun test() { + val (a, b) = + A() +} + // SET_TRUE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES