"Use continuation indent for expression body" for prop initializers
This commit is contained in:
@@ -529,6 +529,18 @@ private val INDENT_RULES = arrayOf<NodeIndentStrategy>(
|
||||
}
|
||||
.set(Indent.getNormalIndent()),
|
||||
|
||||
strategy("Property initializer")
|
||||
.within(KtNodeTypes.PROPERTY)
|
||||
.forElement {
|
||||
it.psi is KtExpression
|
||||
}
|
||||
.set { settings ->
|
||||
if (settings.kotlinCustomSettings.CONTINUATION_INDENT_FOR_EXPRESSION_BODIES)
|
||||
Indent.getContinuationWithoutFirstIndent()
|
||||
else
|
||||
Indent.getNormalIndent()
|
||||
},
|
||||
|
||||
strategy("Indent for parts")
|
||||
.within(KtNodeTypes.PROPERTY, KtNodeTypes.FUN, KtNodeTypes.DESTRUCTURING_DECLARATION, KtNodeTypes.SECONDARY_CONSTRUCTOR)
|
||||
.notForType(KtNodeTypes.BLOCK, FUN_KEYWORD, VAL_KEYWORD, VAR_KEYWORD, CONSTRUCTOR_KEYWORD, KtTokens.RPAR)
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
val x: Int = 1
|
||||
|
||||
val y: Int =
|
||||
2
|
||||
|
||||
fun foo() = 1
|
||||
|
||||
fun bar() =
|
||||
1
|
||||
|
||||
// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES
|
||||
|
||||
+7
-2
@@ -1,8 +1,13 @@
|
||||
val x: Int
|
||||
= 1
|
||||
= 1
|
||||
|
||||
val y: Int =
|
||||
2
|
||||
|
||||
fun foo()
|
||||
= 1
|
||||
= 1
|
||||
|
||||
fun bar() =
|
||||
1
|
||||
|
||||
// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES
|
||||
|
||||
Reference in New Issue
Block a user