JetPsiFactory.createByPattern supports PsiChildRange as argument, used it in ConvertToForEachFunctionCallIntention
This commit is contained in:
@@ -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 -> }
|
||||
}
|
||||
Reference in New Issue
Block a user