Implement intention to remove labeled return from last lambda expression
So #KT-20439 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
35ce30aedc
commit
769e28519e
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.intentions.RemoveLabeledReturnInLambdaIntention
|
||||
@@ -0,0 +1,8 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Remove return@label"
|
||||
|
||||
fun foo() {
|
||||
listOf(1,2,3).find label@{
|
||||
return@label <caret>true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Remove return@label"
|
||||
|
||||
fun foo() {
|
||||
listOf(1,2,3).find label@{
|
||||
true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Remove return@find"
|
||||
|
||||
fun foo() {
|
||||
listOf(1,2,3).find {
|
||||
return@find <caret>true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Remove return@find"
|
||||
|
||||
fun foo() {
|
||||
listOf(1,2,3).find {
|
||||
true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// IS_APPLICABLE: FALSE
|
||||
|
||||
fun foo(): Boolean {
|
||||
return@foo <caret>true
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// WITH_RUNTIME
|
||||
// IS_APPLICABLE: FALSE
|
||||
|
||||
fun foo(): Boolean {
|
||||
listOf(1,2,3).find {
|
||||
return <caret>true
|
||||
}
|
||||
return false
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// WITH_RUNTIME
|
||||
// IS_APPLICABLE: FALSE
|
||||
|
||||
fun foo() {
|
||||
listOf(1,2,3).find {
|
||||
<caret>1
|
||||
return@find true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
// IS_APPLICABLE: FALSE
|
||||
|
||||
fun foo() {
|
||||
listOf(1,2,3).forEach {
|
||||
listOf(1,2,3).find {
|
||||
return@forEach<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Remove return@forEach"
|
||||
|
||||
fun foo() {
|
||||
listOf(1,2,3).forEach {
|
||||
<caret>return@forEach
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Remove return@forEach"
|
||||
|
||||
fun foo() {
|
||||
listOf(1,2,3).forEach {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user