KT-61889 [AA] Migrate KtFirReferenceShortener to ContextCollector
This should make reference shortener considerably faster, since it won't need to perform redundant extra resolve of the file. `ContextCollector` more accurately collects the scopes for the scripts, so some script tests are also fixed. It should fix the following bugs: ^KTIJ-26714 Fixed ^KTIJ-26727 Fixed This is also an important part of fixing the following bugs: - KTIJ-26715 - KTIJ-26734 But those bugs also rely on KT-61890, because completion uses scopes and snows incorrect elements from them
This commit is contained in:
committed by
Space Team
parent
ce900063c0
commit
7b50506aea
+1
@@ -1,6 +1,7 @@
|
||||
Before shortening: one.A
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
[qualifier] one.A
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[qualifier] one.A
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package test
|
||||
|
||||
operator fun String.getValue(a: Any, b: Any): String = this
|
||||
|
||||
val bigProperty: String = "Hello"
|
||||
|
||||
open class Base(s: String) {}
|
||||
|
||||
<expr>
|
||||
class Foo(
|
||||
bigProperty: String,
|
||||
otherParam: String = test.bigProperty
|
||||
) : Base(test.bigProperty),
|
||||
CharSequence by test.bigProperty
|
||||
{
|
||||
val regularProperty = test.bigProperty
|
||||
val delegatedProperty by test.bigProperty
|
||||
val lambdaCapture = { test.bigProperty }
|
||||
|
||||
init {
|
||||
test.bigProperty()
|
||||
}
|
||||
}
|
||||
</expr>
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
Before shortening: class Foo(
|
||||
bigProperty: String,
|
||||
otherParam: String = test.bigProperty
|
||||
) : Base(test.bigProperty),
|
||||
CharSequence by test.bigProperty
|
||||
{
|
||||
val regularProperty = test.bigProperty
|
||||
val delegatedProperty by test.bigProperty
|
||||
val lambdaCapture = { test.bigProperty }
|
||||
|
||||
init {
|
||||
test.bigProperty()
|
||||
}
|
||||
}
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
with SHORTEN_AND_IMPORT:
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package test
|
||||
|
||||
val bigProperty: String = "Hello"
|
||||
|
||||
<expr>
|
||||
class Foo(bigProperty: String) {
|
||||
val propertyWithAccessors
|
||||
get() = test.bigProperty
|
||||
set(value) {
|
||||
test.bigProperty
|
||||
}
|
||||
|
||||
fun functionWithInitializer() = test.bigProperty
|
||||
fun functionWithBody() {
|
||||
return test.bigProperty
|
||||
}
|
||||
}
|
||||
</expr>
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
Before shortening: class Foo(bigProperty: String) {
|
||||
val propertyWithAccessors
|
||||
get() = test.bigProperty
|
||||
set(value) {
|
||||
test.bigProperty
|
||||
}
|
||||
|
||||
fun functionWithInitializer() = test.bigProperty
|
||||
fun functionWithBody() {
|
||||
return test.bigProperty
|
||||
}
|
||||
}
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
[qualifier] test.bigProperty
|
||||
[qualifier] test.bigProperty
|
||||
[qualifier] test.bigProperty
|
||||
[qualifier] test.bigProperty
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[qualifier] test.bigProperty
|
||||
[qualifier] test.bigProperty
|
||||
[qualifier] test.bigProperty
|
||||
[qualifier] test.bigProperty
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[qualifier] test.bigProperty
|
||||
[qualifier] test.bigProperty
|
||||
[qualifier] test.bigProperty
|
||||
[qualifier] test.bigProperty
|
||||
+2
@@ -1,5 +1,7 @@
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
[qualifier] one.A
|
||||
[qualifier] one.B
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[qualifier] one.A
|
||||
[qualifier] one.B
|
||||
|
||||
Reference in New Issue
Block a user