KT-63627 [AA] Properly handle object declarations when traversing scopes in KtFirReferenceShortener
`KtClass` denotes only classes, interfaces and enums. To handle object declarations, we now use `KtClassOrObject` PSI type ^KT-63627 Fixed
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
package test
|
||||
|
||||
class OuterClass {
|
||||
class Nested
|
||||
|
||||
object NestedObject {
|
||||
class Nested
|
||||
|
||||
<expr>fun usage(
|
||||
first: test.OuterClass.Nested,
|
||||
second: test.OuterClass.NestedObject.Nested,
|
||||
) {}</expr>
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
Before shortening: fun usage(
|
||||
first: test.OuterClass.Nested,
|
||||
second: test.OuterClass.NestedObject.Nested,
|
||||
) {}
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
[type] test.OuterClass
|
||||
[type] test.OuterClass.NestedObject.Nested
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[type] test.OuterClass
|
||||
[type] test.OuterClass.NestedObject.Nested
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[type] test.OuterClass
|
||||
[type] test.OuterClass.NestedObject.Nested
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package test
|
||||
|
||||
class OuterClass {
|
||||
class Nested
|
||||
|
||||
companion object {
|
||||
class Nested
|
||||
|
||||
<expr>fun usage(
|
||||
first: test.OuterClass.Nested,
|
||||
second: test.OuterClass.Companion.Nested,
|
||||
) {}</expr>
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
Before shortening: fun usage(
|
||||
first: test.OuterClass.Nested,
|
||||
second: test.OuterClass.Companion.Nested,
|
||||
) {}
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
[type] test.OuterClass
|
||||
[type] test.OuterClass.Companion.Nested
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[type] test.OuterClass
|
||||
[type] test.OuterClass.Companion.Nested
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[type] test.OuterClass
|
||||
[type] test.OuterClass.Companion.Nested
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package test
|
||||
|
||||
class OuterClass {
|
||||
class Nested
|
||||
|
||||
companion object NamedCompanion {
|
||||
class Nested
|
||||
|
||||
<expr>fun usage(
|
||||
first: test.OuterClass.Nested,
|
||||
second: test.OuterClass.NamedCompanion.Nested,
|
||||
) {}</expr>
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
Before shortening: fun usage(
|
||||
first: test.OuterClass.Nested,
|
||||
second: test.OuterClass.NamedCompanion.Nested,
|
||||
) {}
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
[type] test.OuterClass
|
||||
[type] test.OuterClass.NamedCompanion.Nested
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[type] test.OuterClass
|
||||
[type] test.OuterClass.NamedCompanion.Nested
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[type] test.OuterClass
|
||||
[type] test.OuterClass.NamedCompanion.Nested
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package test
|
||||
|
||||
class OuterClass {
|
||||
class Nested
|
||||
|
||||
object NestedObject {
|
||||
class Nested
|
||||
}
|
||||
|
||||
<expr>fun usage(
|
||||
first: test.OuterClass.Nested,
|
||||
second: test.OuterClass.NestedObject.Nested,
|
||||
) {}</expr>
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
Before shortening: fun usage(
|
||||
first: test.OuterClass.Nested,
|
||||
second: test.OuterClass.NestedObject.Nested,
|
||||
) {}
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
[type] test.OuterClass.Nested
|
||||
[type] test.OuterClass.NestedObject
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[type] test.OuterClass.Nested
|
||||
[type] test.OuterClass.NestedObject
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[type] test.OuterClass.Nested
|
||||
[type] test.OuterClass.NestedObject
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package test
|
||||
|
||||
class OuterClass {
|
||||
class Nested
|
||||
|
||||
companion object {
|
||||
class Nested
|
||||
}
|
||||
|
||||
<expr>fun usage(
|
||||
first: test.OuterClass.Nested,
|
||||
second: test.OuterClass.Companion.Nested,
|
||||
) {}</expr>
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
Before shortening: fun usage(
|
||||
first: test.OuterClass.Nested,
|
||||
second: test.OuterClass.Companion.Nested,
|
||||
) {}
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
[type] test.OuterClass.Nested
|
||||
[type] test.OuterClass.Companion
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[type] test.OuterClass.Nested
|
||||
[type] test.OuterClass.Companion
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[type] test.OuterClass.Nested
|
||||
[type] test.OuterClass.Companion
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package test
|
||||
|
||||
class OuterClass {
|
||||
class Nested
|
||||
|
||||
companion object NamedCompanion {
|
||||
class Nested
|
||||
}
|
||||
|
||||
<expr>fun usage(
|
||||
first: test.OuterClass.Nested,
|
||||
second: test.OuterClass.NamedCompanion.Nested,
|
||||
) {}</expr>
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
Before shortening: fun usage(
|
||||
first: test.OuterClass.Nested,
|
||||
second: test.OuterClass.NamedCompanion.Nested,
|
||||
) {}
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
[type] test.OuterClass.Nested
|
||||
[type] test.OuterClass.NamedCompanion
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[type] test.OuterClass.Nested
|
||||
[type] test.OuterClass.NamedCompanion
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[type] test.OuterClass.Nested
|
||||
[type] test.OuterClass.NamedCompanion
|
||||
Reference in New Issue
Block a user