Suggest "Remove braces" in nested if correctly #KT-14270 Fixed

This commit is contained in:
Toshiaki Kameyama
2018-03-07 04:51:02 +03:00
committed by Mikhail Glukhikh
parent 8082a5daf7
commit e328d2d1ca
11 changed files with 119 additions and 1 deletions
+7
View File
@@ -0,0 +1,7 @@
fun foo(i :Int) {}
fun test(i: Int, b: Boolean) {
if (i == 1) {<caret>
if (b) foo(1)
}
}
@@ -0,0 +1,5 @@
fun foo(i :Int) {}
fun test(i: Int, b: Boolean) {
if (i == 1) if (b) foo(1)
}
+11
View File
@@ -0,0 +1,11 @@
// IS_APPLICABLE: false
fun foo(i :Int) {}
fun test(i: Int, b: Boolean) {
if (i == 1) {<caret>
if (b) foo(1)
} else if (i == 2) {
if (b) foo(2)
}
}
+9
View File
@@ -0,0 +1,9 @@
fun foo(i :Int) {}
fun test(i: Int, b: Boolean) {
if (i == 1) {
if (b) foo(1)
} else if (i == 2) {<caret>
if (b) foo(2)
}
}
@@ -0,0 +1,7 @@
fun foo(i :Int) {}
fun test(i: Int, b: Boolean) {
if (i == 1) {
if (b) foo(1)
} else if (i == 2) if (b) foo(2)
}
+11
View File
@@ -0,0 +1,11 @@
// IS_APPLICABLE: false
fun foo(i :Int) {}
fun test(i: Int, b: Boolean) {
if (i == 1) {<caret>
if (b) foo(1)
} else {
if (b) foo(2)
}
}
+9
View File
@@ -0,0 +1,9 @@
fun foo(i :Int) {}
fun test(i: Int, b: Boolean) {
if (i == 1) {
if (b) foo(1)
} else {<caret>
if (b) foo(2)
}
}
@@ -0,0 +1,7 @@
fun foo(i :Int) {}
fun test(i: Int, b: Boolean) {
if (i == 1) {
if (b) foo(1)
} else if (b) foo(2)
}
+13
View File
@@ -0,0 +1,13 @@
// IS_APPLICABLE: false
fun foo(i :Int) {}
fun test(i: Int, b: Boolean) {
if (i == 1) {
if (b) foo(1)
} else if (i == 2) {<caret>
if (b) foo(2)
} else {
if (b) foo(3)
}
}