Skip to content

org.jetbrains.kotlin.analysis.api.symbols

Types

KaAdditionalKDocResolutionProvider

An extension point to provide additional symbols for a KDoc reference. KDoc link resolution will use symbols returned by this extension point only if the real resolution was unsuccessful.

KaAnonymousFunctionSymbol

KaAnonymousObjectSymbol

KaAnonymousObjectSymbol represents anonymous object declarations.

KaBackingFieldSymbol

KaCallableImplementationState

Describes the implementation state of a KaCallableSymbol in the context of a specific KaClassSymbol.

KaCallableSymbol

KaCallableSymbol represents callable declarations, such as functions and variables.

KaClassifierSymbol

KaClassifierSymbol represents a type declaration, including classes, objects, interfaces, type aliases, and type parameters.

KaClassInitializerSymbol

KaClassKind

enum class KaClassKind : Enum<KaClassKind> 

The kind of class represented by a KaClassSymbol.

KaClassLikeSymbol

KaClassLikeSymbol represents a class, object, interface, or type alias declaration.

KaClassSymbol

KaClassSymbol represents a class, object, or interface declaration.

KaConstructorSymbol

KaContextParameterSymbol

KaDebugRenderer

class KaDebugRenderer(
    val renderExtra: Boolean = false, 
    val renderTypeByProperties: Boolean = false, 
    val renderExpandedTypes: Boolean = false, 
    val renderIsPublicApi: Boolean = false
)

KaDeclarationSymbol

Represents a source-representable declaration such as a class, function, or property.

KaDeprecation

Represents the deprecation status of a symbol.

KaDeprecationLevel

Deprecation severity levels, corresponding to DeprecationLevel in the Kotlin standard library.

KaDestructuringDeclarationSymbol

A KaSymbol created from a destructuring declaration (possibly from a lambda parameter).

KaEnumEntrySymbol

KaFileSymbol

KaFunctionSymbol

KaFunctionSymbol represents a function-like declaration, including named and anonymous functions, constructors, and property accessors.

KaJavaFieldSymbol

KaKotlinPropertySymbol

KaKotlinPropertySymbol represents a Kotlin property symbol, in contrast to KaSyntheticJavaPropertySymbol.

KaLocalVariableSymbol

KaNamedClassSymbol

KaNamedClassSymbol represents a named class, object, or interface declaration. The symbol covers most class declarations except for anonymous objects, which are represented by KaAnonymousObjectSymbol.

KaNamedFunctionSymbol

KaNamedFunctionSymbol represents a named function declaration, such as a top-level function, a class method, or a named local function.

KaPackageSymbol

KaPackageSymbol represents a package as a symbol.

KaParameterSymbol

KaParameterSymbol represents a value parameter, context parameter, or receiver parameter.

KaPropertyAccessorSymbol

KaPropertyGetterSymbol

KaPropertySetterSymbol

KaPropertySymbol

KaReceiverParameterSymbol

A symbol for a receiver parameter of an extension function or property.

KaReturnValueStatus

sealed class KaReturnValueStatus

The return value status of the function (should it be used, or can it be ignored).

KaSamConstructorSymbol

KaSamConstructorSymbol represents constructors used to build instances of SAM interfaces.

KaScriptSymbol

KaSymbol

KaSymbols are a core concept in the Analysis API, representing declarations visible to Kotlin. Symbols represent not only declarations in source files, but also declarations from libraries, and those generated by compiler plugins and the compiler itself.

KaSymbolLocation

Describes the location where a KaSymbol is declared in code.

KaSymbolModality

A symbol's modality defines its ability to be inherited.

KaSymbolOrigin

KaSymbolOrigin describes the kind of data source (sources, libraries, etc.) or generation (SAM constructors, compiler plugins, etc.) the symbol originates from.

KaSymbolProvider

@SubclassOptInRequired(markerClass = [KaSessionComponentImplementationDetail::class])
interface KaSymbolProvider : KaSessionComponent

KaSymbolProvider provides KaSymbols for given PSI elements.

KaSymbolVisibility

The visibility of a KaSymbol. As symbols can represent both Kotlin and Java declarations, KaSymbolVisibility covers both visibility definitions.

KaSyntheticJavaPropertySymbol

KaSyntheticJavaPropertySymbol represents a synthetic property generated by the compiler for a Java field associated with a getter or setter. This allows Java fields to be accessed like Kotlin properties.

KaTypeAliasSymbol

KaTypeAliasSymbol represents a type alias declaration.

KaTypeParameterSymbol

KaTypeParameterSymbol represents a type parameter of a class, function, property, or type alias.

KaValueParameterSymbol

KaValueParameterSymbol represents a value parameter of a function, constructor, or property setter.

KaVariableSymbol

KaVariableSymbol represents a variable-like declaration, including properties, local variables, and value parameters.

Properties

classSymbol

A KaClassSymbol for the given KtClassOrObject, or null for KtEnumEntry declarations.

namedClassSymbol

A KaNamedClassSymbol for the given named KtClassOrObject, or null for KtEnumEntry declarations and object literals.

rootPackageSymbol

A KaPackageSymbol for the root package, which is the special package with an empty fully-qualified name.

symbol

A KaVariableSymbol that corresponds to the local variable introduced by the given KtDestructuringDeclarationEntry.

context(session: KaSession)
val KtFile.symbol: KaFileSymbol

A KaFileSymbol for a KtFile.

context(session: KaSession)
val KtParameter.symbol: KaVariableSymbol

A KaVariableSymbol for the given KtParameter.

context(session: KaSession)
val KtProperty.symbol: KaVariableSymbol

A KaVariableSymbol for the given KtProperty.

Functions

findClass

context(session: KaSession)
fun findClass(classId: ClassId): KaNamedClassSymbol?

Returns a KaNamedClassSymbol for the specified ClassId, or null if such a symbol cannot be found.

findClassLike

context(session: KaSession)
fun findClassLike(classId: ClassId): KaClassLikeSymbol?

Returns a KaClassLikeSymbol for the specified ClassId, or null if such a symbol cannot be found.

findPackage

context(session: KaSession)
fun findPackage(fqName: FqName): KaPackageSymbol?

Returns a KaPackageSymbol corresponding to the given fqName if that package exists and is visible from the current use site, or null otherwise.

findTopLevelCallables

context(session: KaSession)
fun findTopLevelCallables(packageFqName: FqName, name: Name): Sequence<KaCallableSymbol>

Finds top-level functions and properties called name in the package called packageFqName. Returns only symbols that are visible from the current use-site module.

findTypeAlias

context(session: KaSession)
fun findTypeAlias(classId: ClassId): KaTypeAliasSymbol?

Returns a KaTypeAliasSymbol for the specified ClassId, or null if such a symbol cannot be found.