Single indent for multi-declarations for official codestyle (KT-27847)

#KT-27847 Fixed
This commit is contained in:
Nikolay Krasko
2018-10-30 11:53:35 +03:00
parent a8fc9d6b6f
commit 2684974a33
3 changed files with 21 additions and 0 deletions
@@ -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(
@@ -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
@@ -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