Skip to content

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

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.contentScope of module, as KaResolveExtensionProvider.provideExtensionsFor is used to lazily calculate content scopes.

  • Also avoid using KaModuleProvider or the project structure provider, as content scope calculation may be triggered during getModule.