Single indent for multi-declarations for official codestyle (KT-27847)
#KT-27847 Fixed
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user