f590e88bdd
KtResolveExtensions are designed to handle IDE analysis use cases where source might not be available at analysis time, because that source is generated by an external source generator, such as an annotation processor or resource compiler. The sources generated by those external generators can appear in the analysis scope, and cause issues with source clash - resolution may find the virtual source from the KtResolveExtension, the on-disk generated source from the external generator, or both. This can cause issues, because that on-disk generated source may be stale, and may not have symbols that will exist the next time the generator is run (or, conversely, may have symbols that will disappear on the next build). To solve this, add a `getShadowedScope(): GlobalSearchScope` to `KtResolveExtension`. Any files in the module that are included in that scope will be hidden from resolution, allowing the resolve extension to cleanly replace those files. ^KT-58834 fixed
15 lines
322 B
Kotlin
Vendored
15 lines
322 B
Kotlin
Vendored
// MODULE: extendedModule
|
|
// FILE: generated.hidden.kt
|
|
package generated
|
|
|
|
fun String.generatedOverloadedExtensionFunction(): Int = TODO()
|
|
|
|
// MODULE: dependency2
|
|
|
|
// MODULE: main(extendedModule, dependency2)()()
|
|
// FILE: main.kt
|
|
import generated.*
|
|
|
|
fun main() {
|
|
"string".generatedOverloadedExtension<caret>Function()
|
|
} |