Rename: Support labeled expressions

#KT-7107 Fixed
This commit is contained in:
Alexey Sedunov
2017-04-24 20:22:07 +03:00
parent 63d32a524c
commit 3c94184de9
46 changed files with 395 additions and 52 deletions
@@ -0,0 +1,5 @@
fun <R> foo(f: () -> R) = f()
fun test() {
foo (baz@ fun(): Boolean { return@baz false })
}
@@ -0,0 +1,5 @@
fun <R> foo(f: () -> R) = f()
fun test() {
foo (/*rename*/bar@ fun(): Boolean { return@bar false })
}
@@ -0,0 +1,5 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test.kt",
"newName": "baz"
}
@@ -0,0 +1,5 @@
fun <R> foo(f: () -> R) = f()
fun test() {
foo baz@ { return@baz false }
}
@@ -0,0 +1,5 @@
fun <R> foo(f: () -> R) = f()
fun test() {
foo /*rename*/bar@ { return@bar false }
}
@@ -0,0 +1,5 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test.kt",
"newName": "baz"
}
@@ -0,0 +1,5 @@
fun <R> foo(f: () -> R) = f()
fun test() {
foo baz@ { return@baz false }
}
@@ -0,0 +1,5 @@
fun <R> foo(f: () -> R) = f()
fun test() {
foo bar@ { return@/*rename*/bar false }
}
@@ -0,0 +1,5 @@
{
"type": "AUTO_DETECT",
"mainFile": "test.kt",
"newName": "baz"
}
@@ -0,0 +1,5 @@
fun <R> foo(f: () -> R) = f()
fun test() {
foo (baz@ { return@baz false })
}
@@ -0,0 +1,5 @@
fun <R> foo(f: () -> R) = f()
fun test() {
foo (/*rename*/bar@ { return@bar false })
}
@@ -0,0 +1,5 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test.kt",
"newName": "baz"
}
@@ -0,0 +1,5 @@
fun <R> foo(f: () -> R) = f()
fun test() {
foo baz@ { return@baz false }
}
@@ -0,0 +1,5 @@
fun <R> foo(f: () -> R) = f()
fun test() {
foo /*rename*/foo@ { return@foo false }
}
@@ -0,0 +1,5 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test.kt",
"newName": "baz"
}
@@ -0,0 +1,5 @@
fun <R> foo(f: () -> R) = f()
fun test() {
foo (bar2@ baz@ { return@baz false })
}
@@ -0,0 +1,5 @@
fun <R> foo(f: () -> R) = f()
fun test() {
foo (bar2@ /*rename*/bar@ { return@bar false })
}
@@ -0,0 +1,5 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test.kt",
"newName": "baz"
}
@@ -0,0 +1,6 @@
fun test() {
bar@ for (n in 1..10) {
if (n == 5) continue@bar
if (n > 8) break@bar
}
}
@@ -0,0 +1,6 @@
fun test() {
/*rename*/foo@ for (n in 1..10) {
if (n == 5) continue@foo
if (n > 8) break@foo
}
}
@@ -0,0 +1,5 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test.kt",
"newName": "bar"
}
@@ -0,0 +1,6 @@
fun test() {
bar@ for (n in 1..10) {
if (n == 5) continue@bar
if (n > 8) break@bar
}
}
@@ -0,0 +1,6 @@
fun test() {
foo@ for (n in 1..10) {
if (n == 5) continue@foo
if (n > 8) break@/*rename*/foo
}
}
@@ -0,0 +1,5 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test.kt",
"newName": "bar"
}
@@ -0,0 +1,6 @@
fun test() {
bar@ for (n in 1..10) {
if (n == 5) continue@bar
if (n > 8) break@bar
}
}
@@ -0,0 +1,6 @@
fun test() {
foo@ for (n in 1..10) {
if (n == 5) continue@/*rename*/foo
if (n > 8) break@foo
}
}
@@ -0,0 +1,5 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test.kt",
"newName": "bar"
}