Initial implementation of KT-7688 Intention action to iterate over iterable value

#KT-7688 Fixed
This commit is contained in:
Valentin Kipyatkov
2015-06-26 14:12:43 +02:00
parent 4fc67c27b0
commit 2206459874
17 changed files with 173 additions and 25 deletions
+1
View File
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.intentions.IterateExpressionIntention
@@ -0,0 +1,7 @@
// WITH_RUNTIME
fun foo() {
f()<caret>
}
fun f(): List<Int> = emptyList()
@@ -0,0 +1,9 @@
// WITH_RUNTIME
fun foo() {
for (i in f()) {
<caret>
}
}
fun f(): List<Int> = emptyList()
+3
View File
@@ -0,0 +1,3 @@
fun foo(list: List<String>) {
list<caret>
}
@@ -0,0 +1,5 @@
fun foo(list: List<String>) {
for (s in list) {
<caret>
}
}