Quick Fixes: Implement "Rename unresolved reference" fix
#KT-8795 Fixed
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
// "Rename reference" "true"
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
class A {
|
||||
fun f() = 1
|
||||
fun g() = ""
|
||||
}
|
||||
|
||||
class B
|
||||
|
||||
fun bar(i: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun baz(i: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun foo(a: A, b: B) {
|
||||
val aa = A()
|
||||
bar(a.x)
|
||||
baz(a.x)
|
||||
bar(a.<caret>x())
|
||||
baz(a.x())
|
||||
bar(a.x(1))
|
||||
baz(a.x(1))
|
||||
bar(aa.x())
|
||||
bar(b.x())
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// "Rename reference" "true"
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
class A {
|
||||
fun f() = 1
|
||||
fun g() = ""
|
||||
}
|
||||
|
||||
class B
|
||||
|
||||
fun bar(i: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun baz(i: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun foo(a: A, b: B) {
|
||||
val aa = A()
|
||||
bar(a.x)
|
||||
baz(a.x)
|
||||
bar(a.f<caret>())
|
||||
baz(a.f())
|
||||
bar(a.x(1))
|
||||
baz(a.x(1))
|
||||
bar(aa.x())
|
||||
bar(b.x())
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// "Rename reference" "true"
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
class A {
|
||||
val a = 1
|
||||
val s = ""
|
||||
}
|
||||
|
||||
class B
|
||||
|
||||
fun bar(i: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun baz(i: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun foo(a: A, b: B) {
|
||||
val aa = A()
|
||||
bar(a.x<caret>)
|
||||
baz(a.x)
|
||||
bar(a.x())
|
||||
baz(a.x(1))
|
||||
bar(aa.x)
|
||||
bar(b.x)
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
// "Rename reference" "true"
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
class A {
|
||||
val a = 1
|
||||
val s = ""
|
||||
}
|
||||
|
||||
class B
|
||||
|
||||
fun bar(i: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun baz(i: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun foo(a: A, b: B) {
|
||||
val aa = A()
|
||||
bar(a.a<caret>)
|
||||
baz(a.a)
|
||||
bar(a.x())
|
||||
baz(a.x(1))
|
||||
bar(aa.x)
|
||||
bar(b.x)
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// "Rename reference" "false"
|
||||
// ACTION: Create annotation 'X'
|
||||
// ACTION: Create class 'X'
|
||||
// ACTION: Create enum 'X'
|
||||
// ACTION: Create interface 'X'
|
||||
// ERROR: Unresolved reference: X
|
||||
// ERROR: Unresolved reference: X
|
||||
class A {
|
||||
class B
|
||||
|
||||
fun foo() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun test(x: A.<caret>X) {
|
||||
val t: A.X
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
// "Rename reference" "true"
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
class A {
|
||||
fun f() = 1
|
||||
fun g() = ""
|
||||
|
||||
fun bar(i: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun baz(i: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
bar(x)
|
||||
baz(x)
|
||||
bar(<caret>x())
|
||||
baz(x())
|
||||
bar(x(1))
|
||||
baz(x(1))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
// "Rename reference" "true"
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
class A {
|
||||
fun f() = 1
|
||||
fun g() = ""
|
||||
|
||||
fun bar(i: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun baz(i: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
bar(x)
|
||||
baz(x)
|
||||
bar(f<caret>())
|
||||
baz(f())
|
||||
bar(x(1))
|
||||
baz(x(1))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// "Rename reference" "true"
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
class A {
|
||||
val a = 1
|
||||
val s = ""
|
||||
|
||||
fun bar(i: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun baz(i: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
bar(<caret>x)
|
||||
baz(x)
|
||||
bar(x())
|
||||
baz(x(1))
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
// "Rename reference" "true"
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
class A {
|
||||
val a = 1
|
||||
val s = ""
|
||||
|
||||
fun bar(i: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun baz(i: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
bar(a<caret>)
|
||||
baz(a)
|
||||
bar(x())
|
||||
baz(x(1))
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
// "Rename reference" "true"
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
package x
|
||||
|
||||
class A {
|
||||
val a = 1
|
||||
val s = ""
|
||||
|
||||
fun bar(i: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun baz(i: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
bar(<caret>x)
|
||||
baz(x)
|
||||
bar(x())
|
||||
baz(x(1))
|
||||
}
|
||||
}
|
||||
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
// "Rename reference" "true"
|
||||
// ERROR: Unresolved reference: x
|
||||
// ERROR: Unresolved reference: x
|
||||
package x
|
||||
|
||||
class A {
|
||||
val a = 1
|
||||
val s = ""
|
||||
|
||||
fun bar(i: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun baz(i: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
bar(a<caret>)
|
||||
baz(a)
|
||||
bar(x())
|
||||
baz(x(1))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user