Skip to content

org.jetbrains.kotlin.analysis.api.projectStructure

Types

KaBuiltinsModule

A module which contains Kotlin builtins for a specific platform.

KaDanglingFileModule

A module for a dangling file. Such files are usually temporary and are stored in-memory.

KaDanglingFileResolutionMode

Specifies how references to non-local declarations in dangling files should be resolved.

KaDanglingFileResolutionModeProvider

A service that provides KaDanglingFileResolutionMode for a given KtFile based purely on its content.

KaJvmTarget

class KaJvmTarget

Represents a JVM bytecode target version for compilation.

KaLibraryFallbackDependenciesModule

A module which stands in for the unknown dependencies of a KaLibraryModule and KaLibrarySourceModule.

KaLibraryModule

A module which represents a binary library, such as a JAR or KLIB.

KaLibrarySourceModule

A module which represents the sources for a KaLibraryModule.

KaModule

KaModule is the Analysis API's view on a module inside a project. A KaModule represents a source set (with production and test sources being separate modules), script, library, and various niche concepts such as dangling files.

KaModuleProvider

KaNotUnderContentRootModule

A module which represents a source file living outside the project's content root. For example, test data files, or the source files of another project.

KaScriptDependencyModule

A module for Kotlin script dependencies. Must either be a KaLibraryModule or KaLibrarySourceModule.

KaScriptModule

A module for a Kotlin script file.

KaSourceModule

A KaModule representing a set of source declarations.

Properties

contextModule

A context module against which analysis of this in-memory file should be performed. It can only be specified for an in-memory file.

copyOrigin

val PsiFile.copyOrigin: PsiFile?

The original file if the given PsiFile is a file copy, or null otherwise.

danglingFileResolutionMode

The resolution mode explicitly set for this dangling file, or null for files that are not dangling or if the mode was not set.

explicitModule

A module to be used for analyzing the given file. Currently, only KaDanglingFileModules can be set as explicit modules.

isDangling

Whether the KtFile is a dangling file.

kaModule

context(session: KaSession)
val PsiElement.kaModule: KaModule

A KaModule for a given this in the context of the session's useSiteModule.

refinedContextModule

A context module against which analysis of this code fragment should be performed.

Functions

kaModule

fun PsiElement.kaModule(useSiteModule: KaModule?): KaModule

Returns a KaModule for a given this in the context of the useSiteModule.

withDanglingFileResolutionMode

fun <R> withDanglingFileResolutionMode(
    file: KtFile, 
    mode: KaDanglingFileResolutionMode, 
    action: () -> R
): R

Runs the action with a resolution mode being explicitly set for the dangling file.