JetPsiFactory.createByPattern supports PsiChildRange as argument, used it in ConvertToForEachFunctionCallIntention

This commit is contained in:
Valentin Kipyatkov
2015-05-26 00:03:44 +03:00
parent b957584d91
commit 8b44c93667
7 changed files with 68 additions and 31 deletions
@@ -1,7 +1,8 @@
fun foo() {
val list = 1..4
list.forEach { x ->// start of loop
list.forEach { x ->
// start of loop
// comment 1
var v = x + 1
// comment 2
@@ -1,7 +1,8 @@
fun foo() {
val list = 1..4
list.forEach { x ->// comment
list.forEach { x ->
// comment
var v = x + 1
}
}
@@ -0,0 +1,4 @@
fun foo() {
<caret>for (x in 1..10) {
}
}
@@ -0,0 +1,3 @@
fun foo() {
(1..10).forEach { x -> }
}