[Analysis API] add method for implicit companion object reference detection
Add a new method `isImplicitReferenceToCompanion` to determine if the given reference is an implicit reference to a companion object. The method is needed for the rename refactoring in IJ. ^KTIJ-25863
This commit is contained in:
committed by
Space Team
parent
f5bbf2b4fe
commit
8b0eb0488f
+9
@@ -0,0 +1,9 @@
|
||||
class AA {
|
||||
companion object {
|
||||
fun x() = 10
|
||||
}
|
||||
}
|
||||
fun main() {
|
||||
A<caret>A.Companion.x()
|
||||
}
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
isImplicitCompanionReference: false
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class AA {
|
||||
companion object BB {
|
||||
fun x() = 10
|
||||
}
|
||||
}
|
||||
fun main() {
|
||||
A<caret>A.BB.x()
|
||||
}
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
isImplicitCompanionReference: false
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class AA {
|
||||
companion object {
|
||||
fun x() = 10
|
||||
}
|
||||
}
|
||||
fun main() {
|
||||
A<caret>A()
|
||||
}
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
isImplicitCompanionReference: false
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
class AA {
|
||||
companion object {
|
||||
operator fun invoke() {}
|
||||
}
|
||||
}
|
||||
|
||||
fun main() {
|
||||
A<caret>A()
|
||||
}
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
isImplicitCompanionReference: false
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class AA {
|
||||
companion object {
|
||||
fun x() = 10
|
||||
}
|
||||
}
|
||||
fun main() {
|
||||
AA.Com<caret>panion.x()
|
||||
}
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
isImplicitCompanionReference: false
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class AA {
|
||||
companion object BB {
|
||||
fun x() = 10
|
||||
}
|
||||
}
|
||||
fun main() {
|
||||
AA.B<caret>B.x()
|
||||
}
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
isImplicitCompanionReference: false
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
class AA {
|
||||
companion object {
|
||||
fun x() = 10
|
||||
}
|
||||
}
|
||||
fun main() {
|
||||
A<caret>A.x()
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
isImplicitCompanionReference: true
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
class AA {
|
||||
companion object {
|
||||
fun x() = 10
|
||||
}
|
||||
}
|
||||
fun main() {
|
||||
A<caret>A
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
isImplicitCompanionReference: true
|
||||
Reference in New Issue
Block a user