KaResolveExtensionProvider¶
abstract class KaResolveExtensionProvider
Provides resolve extensions for KaModules. Resolve extensions provide additional Kotlin files containing generated declarations, which will be included in the resolution as if they were regular source files in the module.
Constructors¶
KaResolveExtensionProvider¶
constructor()
Types¶
Companion¶
object Companion
Functions¶
provideExtensionsFor¶
abstract fun provideExtensionsFor(module: KaModule): List<KaResolveExtension>
Provides a list of resolve extensions for the given module.
The function should not generate the actual file text or perform any heavy analysis. Any file text should only be generated lazily in KaResolveExtensionFile.buildFileText.
Additionally, all implementations should:
-
Consider caching the results for subsequent invocations.
-
Avoid using Kotlin resolution, as this function is called during session initialization, so Analysis API access is forbidden.
-
Avoid using
KaModule.contentScopeofmodule, asKaResolveExtensionProvider.provideExtensionsForis used to lazily calculate content scopes. -
Also avoid using
KaModuleProvideror the project structure provider, as content scope calculation may be triggered duringgetModule.