New Intention: Replace for loop with forEach

Replaces an expression of the form “for (i in list) { … }” with an
expression of the form “list.forEach { i -> … }”
This commit is contained in:
Pradyoth Kukkapalli
2014-04-07 11:50:09 -04:00
committed by Mikhael Bogdanov
parent dbb28c571b
commit 33fd82cf45
23 changed files with 233 additions and 2 deletions
@@ -0,0 +1,3 @@
fun foo() {
list.forEach { x -> x.bar() }
}
@@ -0,0 +1,5 @@
fun foo() {
<spot>for (x in list) {
x.bar()
}</spot>
}
@@ -0,0 +1,5 @@
<html>
<body>
This intention transforms a for loop expression into a function call to "forEach"
</body>
</html>