Replace with for-each: add new-lines using comment saver
Related to KT-15858
This commit is contained in:
+3
-1
@@ -1,4 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
fun main() {
|
||||
1.rangeTo(2).forEach { x -> x }
|
||||
1.rangeTo(2).forEach { x ->
|
||||
x
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -2,5 +2,7 @@
|
||||
fun foo() {}
|
||||
|
||||
fun test() {
|
||||
listOf(1, 2).forEach { l -> /* comment */ }
|
||||
listOf(1, 2).forEach { l ->
|
||||
/* comment */
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
(1..10/* from 1 to 10 */).forEach { x /* current */ -> }
|
||||
(1..10/* from 1 to 10 */).forEach { x /* current */ ->
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
(1..10).forEach { x -> }
|
||||
(1..10).forEach { x ->
|
||||
}
|
||||
}
|
||||
Vendored
+3
-1
@@ -2,5 +2,7 @@
|
||||
fun main() {
|
||||
val list = 1..4
|
||||
|
||||
list.forEach { x: Int -> x }
|
||||
list.forEach { x: Int ->
|
||||
x
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -3,6 +3,8 @@ fun foo() {
|
||||
val list = 1..4
|
||||
val i = 0
|
||||
|
||||
list.forEach { i -> i }
|
||||
list.forEach { i ->
|
||||
i
|
||||
}
|
||||
i
|
||||
}
|
||||
+2
-1
@@ -2,5 +2,6 @@
|
||||
fun foo() {
|
||||
val list = 1..4
|
||||
|
||||
list.forEach { i -> }
|
||||
list.forEach { i ->
|
||||
}
|
||||
}
|
||||
@@ -2,5 +2,7 @@
|
||||
fun foo() {
|
||||
val list = 1..4
|
||||
|
||||
list.forEach { x -> x }
|
||||
list.forEach { x ->
|
||||
x
|
||||
}
|
||||
}
|
||||
Vendored
+3
-1
@@ -2,5 +2,7 @@
|
||||
fun main() {
|
||||
val list = 1..4
|
||||
|
||||
list.forEach { x: Int -> 11 }
|
||||
list.forEach { x: Int ->
|
||||
11
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user