Add quickfix removing names of function expressions
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
// "Remove identifier from function expression" "true"
|
||||
|
||||
fun foo() {
|
||||
(fun bar<caret>() {
|
||||
return@bar
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Remove identifier from function expression" "true"
|
||||
|
||||
fun foo() {
|
||||
(bar@ fun() {
|
||||
return@bar
|
||||
})
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun main() {
|
||||
(fun() {})
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
// "Remove identifier from function expressions in the whole project" "true"
|
||||
|
||||
inline fun run(block: () -> Unit) = block()
|
||||
annotation class ann
|
||||
|
||||
fun foo() {
|
||||
l2@ @ann l2@ fun local() {
|
||||
run(l1@ fun() { return@l1 })
|
||||
|
||||
run(label@ expr@ fun() {
|
||||
return@label
|
||||
return@expr
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
class A {
|
||||
fun bar() {
|
||||
run(toRun@ fun() {
|
||||
if (1 == 1) return@toRun
|
||||
return@bar
|
||||
})
|
||||
|
||||
run(
|
||||
/* abc */ fun /* cde */ () {
|
||||
return@bar
|
||||
}
|
||||
)
|
||||
|
||||
run(
|
||||
/* abc */
|
||||
foo@ fun /* cde */ () {
|
||||
return@foo
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
init {
|
||||
(foo@ fun A.() {
|
||||
(fun() {
|
||||
val x = 1
|
||||
})
|
||||
return@foo
|
||||
})
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
// "Remove identifier from function expressions in the whole project" "true"
|
||||
|
||||
inline fun run(block: () -> Unit) = block()
|
||||
annotation class ann
|
||||
|
||||
fun foo() {
|
||||
l2@ @ann l2@ fun local() {
|
||||
run(l1@ fun() { return@l1 })
|
||||
|
||||
run(label@ fun expr<caret>() {
|
||||
return@label
|
||||
return@expr
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
class A {
|
||||
fun bar() {
|
||||
run(fun toRun() {
|
||||
if (1 == 1) return@toRun
|
||||
return@bar
|
||||
})
|
||||
|
||||
run(
|
||||
/* abc */ fun /* cde */ toRun() {
|
||||
return@bar
|
||||
}
|
||||
)
|
||||
|
||||
run(
|
||||
/* abc */
|
||||
fun /* cde */ foo() {
|
||||
return@foo
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
init {
|
||||
(fun A.foo() {
|
||||
(fun bar() {
|
||||
val x = 1
|
||||
})
|
||||
return@foo
|
||||
})
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun main() {
|
||||
(fun foo() {})
|
||||
}
|
||||
Reference in New Issue
Block a user