KT-4562 New Intention: Add and Remove braces from control statements that have single line bodies

This commit is contained in:
gavinkeusch
2014-03-05 16:59:14 -08:00
committed by Evgeny Gerashchenko
parent b6a9772508
commit 2f613638c2
49 changed files with 523 additions and 2 deletions
@@ -0,0 +1,4 @@
fun foo() {
<caret>do println("test")
while(true)
}
@@ -0,0 +1,5 @@
fun foo() {
do {
println("test")
} while(true)
}
@@ -0,0 +1,4 @@
fun foo() {
if (true) println("test")
<caret>else println("test2")
}
@@ -0,0 +1,6 @@
fun foo() {
if (true) println("test")
else {
println("test2")
}
}
@@ -0,0 +1,4 @@
fun foo() {
for (i in 1..4)
<caret>println("test")
}
@@ -0,0 +1,5 @@
fun foo() {
for (i in 1..4) {
println("test")
}
}
@@ -0,0 +1,3 @@
fun foo() {
<caret>if (true) println("test") else println("test2")
}
@@ -0,0 +1,5 @@
fun foo() {
if (true) {
println("test")
} else println("test2")
}
@@ -0,0 +1,3 @@
fun foo() {
<caret>if (true)println("test")
}
@@ -0,0 +1,5 @@
fun foo() {
if (true) {
println("test")
}
}
@@ -0,0 +1,3 @@
fun foo() {
<caret>if (true) println("test");
}
@@ -0,0 +1,5 @@
fun foo() {
if (true) {
println("test")
}
}
@@ -0,0 +1,4 @@
fun foo() {
<caret>while (true)
println("test")
}
@@ -0,0 +1,5 @@
fun foo() {
while (true) {
println("test")
}
}
@@ -0,0 +1,6 @@
// IS_APPLICABLE: false
fun foo() {
<caret>if (true) {
println("test")
}
}
@@ -0,0 +1,5 @@
fun foo() {
do {
println("test")
<caret>} while(true)
}
@@ -0,0 +1,4 @@
fun foo() {
do println("test")
while(true)
}
@@ -0,0 +1,7 @@
// IS_APPLICABLE: false
fun foo() {
do {
println("test")
println("test2")
<caret>} while(true)
}
@@ -0,0 +1,7 @@
fun foo() {
if (true) {
println("test")
} <caret>else {
println("test2")
}
}
@@ -0,0 +1,5 @@
fun foo() {
if (true) {
println("test")
} else println("test2")
}
@@ -0,0 +1,5 @@
fun foo() {
for<caret> (i in 1..4) {
println("test")
}
}
@@ -0,0 +1,3 @@
fun foo() {
for (i in 1..4) println("test")
}
@@ -0,0 +1,5 @@
fun foo() {
<caret>if (true) {
println("test")
}
}
@@ -0,0 +1,3 @@
fun foo() {
if (true) println("test")
}
@@ -0,0 +1,6 @@
fun foo() {
<caret>if (true) {
//comment
println("test")
}
}
@@ -0,0 +1,4 @@
fun foo() {
//comment
if (true) println("test")
}
@@ -0,0 +1,4 @@
// IS_APPLICABLE: false
fun foo() {
if (true) { }
}
@@ -0,0 +1,5 @@
fun foo() {
<caret>if (true) {
println("test");
}
}
@@ -0,0 +1,3 @@
fun foo() {
if (true) println("test")
}
@@ -0,0 +1,7 @@
// IS_APPLICABLE: false
fun foo() {
if (true) {
println("test")
println("test2")
<caret>}
}
@@ -0,0 +1,5 @@
fun foo() {
while (true) {
println("test")
<caret>}
}
@@ -0,0 +1,3 @@
fun foo() {
while (true) println("test")
}
@@ -0,0 +1,7 @@
// IS_APPLICABLE: false
fun foo() {
while (true) {
println("test")
println("test2")
<caret>}
}