Make assignment indent conforms with indent for expression bodies (KT-28484)

Do not make plain list of binary expression for assignment expressions.

 #KT-28484 Fixed
This commit is contained in:
Nikolay Krasko
2018-11-27 15:23:33 +03:00
parent 699e3397d9
commit 05b2443988
9 changed files with 167 additions and 12 deletions
@@ -35,4 +35,5 @@ fun test() {
1..2
}
// SET_TRUE: ALIGN_MULTILINE_BINARY_OPERATION
// SET_TRUE: ALIGN_MULTILINE_BINARY_OPERATION
// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES
@@ -2,19 +2,19 @@ fun test() {
var a = 12
a =
12
12
a +=
12
12
a -=
12
12
a *=
12
12
a /=
12
12
a is
String
@@ -35,4 +35,5 @@ fun test() {
1..2
}
// SET_TRUE: ALIGN_MULTILINE_BINARY_OPERATION
// SET_TRUE: ALIGN_MULTILINE_BINARY_OPERATION
// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES
@@ -35,4 +35,5 @@ fun test() {
1..2
}
// SET_TRUE: ALIGN_MULTILINE_BINARY_OPERATION
// SET_TRUE: ALIGN_MULTILINE_BINARY_OPERATION
// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES
@@ -0,0 +1,36 @@
var a: Any? = null
var b: Any? = null
var i = 0
var j = 0
fun test() {
a1 =
1
a =
b
a =
"Some"
i +=
j * j
i =
j ?: 0
i -=
j
i *=
0
i %=
5
i /=
2
}
// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES
@@ -0,0 +1,36 @@
var a: Any? = null
var b: Any? = null
var i = 0
var j = 0
fun test() {
a1 =
1
a =
b
a =
"Some"
i +=
j * j
i =
j ?: 0
i -=
j
i *=
0
i %=
5
i /=
2
}
// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES
@@ -0,0 +1,36 @@
var a: Any? = null
var b: Any? = null
var i = 0
var j = 0
fun test() {
a1 =
1
a =
b
a =
"Some"
i +=
j * j
i =
j ?: 0
i -=
j
i *=
0
i %=
5
i /=
2
}
// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES