Skip to content

org.jetbrains.kotlin.analysis.api.components

Types

KaAnalysisScopeProvider

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

KaArrayTypeBuilder

A builder for array types.

KaBuiltinFunctionTypeFamilies

KaBuiltinTypes

KaCallableImplementationState

KaClassTypeBuilder

A builder for class types.

KaCodeCompilationException

KaCompilationOptions

KaCompilationOptionsBuilder

KaCompilationResult

sealed class KaCompilationResult

The type has been moved to a new package. Use <strong>org.jetbrains.kotlin.analysis.api.compilation.KaCompilationResult</strong> instead.

KaCompilationTarget

KaCompiledClassHandler

KaCompiledFile

KaCompilerFacility

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

KaCompilerFacilityModuleActualizer

KaCompilerPluginGeneratedDeclarations

KaCompilerPluginGeneratedDeclarationsProvider

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

Provides declarations generated by compiler plugins.

KaCompletionCandidateChecker

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

KaCompletionExtensionCandidateChecker

KaDataFlowExitPointSnapshot

class KaDataFlowExitPointSnapshot(
    val defaultExpressionInfo: KaDataFlowExitPointSnapshot.DefaultExpressionInfo?, 
    val valuedReturnExpressions: List<KtExpression>, 
    val returnValueType: KaType?, 
    val jumpExpressions: List<KtExpression>, 
    val hasJumps: Boolean, 
    val hasEscapingJumps: Boolean, 
    val hasMultipleJumpKinds: Boolean, 
    val hasMultipleJumpTargets: Boolean, 
    val variableReassignments: List<KaDataFlowExitPointSnapshot.VariableReassignment>
)

KaDataFlowProvider

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

KaDeprecation

KaDeprecationLevel

The type has been moved to a new package. Use <strong>org.jetbrains.kotlin.analysis.api.symbols.KaDeprecationLevel</strong> instead.

KaDiagnosticCheckerFilter

KaDiagnosticCheckerFilter controls which kinds of diagnostics are included in the result of diagnostic collection.

KaDiagnosticProvider

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

KaEvaluator

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

KaExpressionInformationProvider

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

KaExpressionTypeProvider

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

KaExtensionApplicabilityResult

Represents the result of checking the applicability of an extension callable in a specific context.

KaFunctionTypeFamily

KaImplicitReceiver

Represents an implicit receiver available in a particular context.

KaImplicitReceiverSmartCast

KaImplicitReceiverSmartCastKind

KaJavaInteroperabilityComponent

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

KaKDocProvider

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

Component that locates KDoc for KtDeclaration and KaDeclarationSymbol.

KaReferenceShortener

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

KaRenderer

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

Provides services for rendering declaration symbols and types to strings.

KaResolveExtensionInfoProvider

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

KaResolver

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

KaReturnValueStatus

sealed class KaReturnValueStatus

The type has been moved to a new package. Use <strong>org.jetbrains.kotlin.analysis.api.symbols.KaReturnValueStatus</strong> instead.

KaScopeContext

A scope context includes all scopes that are relevant for a given KtElement position in a KtFile, together with all available implicit receivers.

KaScopeImplicitArgumentValue

Represents an implicit argument available in a particular KaScopeContext.

KaScopeImplicitReceiverValue

Represents an implicit receiver available in a particular KaScopeContext.

KaScopeImplicitValue

Represents a value which can be used implicitly inside a particular KaScopeContext.

KaScopeKind

sealed interface KaScopeKind

KaScopeKinds

object KaScopeKinds

KaScopeProvider

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

KaScopeWithKind

A wrapper around a KaScope which is additionally positioned in the scope tower of a KaScopeContext, represented by KaScopeKind.

KaScopeWithKindImpl

class KaScopeWithKindImpl(backingScope: KaScope, backingKind: KaScopeKind) : KaScopeWithKind

KaSessionComponent

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

A component of a KaSession.

KaSignatureSubstitutor

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

KaSmartCastInfo

KaSmartCastPossibility

Represents a possible smart cast at a fixed context position.

KaSmartCastSource

Either a symbol for which a smart cast is generated, or one of its receivers.

KaSourceProvider

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

KaSubstitutorBuilder

KaSubstitutorProvider

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

KaSubtypingErrorTypePolicy

KaSymbolInformationProvider

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

KaSymbolRelationProvider

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

KaTypeBuilder

KaTypeCreator

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

KaTypeCreatorProvider

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

Provides an instance of KaTypeCreator to create various types.

KaTypeInformationProvider

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

KaTypeParameterTypeBuilder

A builder for type parameter types.

KaTypeProvider

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

KaTypeRelationChecker

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

KaUnificationSubstitutorPolicy

KaUseSiteVisibilityChecker

KaVisibilityChecker

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

KaWhenMissingCase

sealed class KaWhenMissingCase

Represents a missing case in a when expression.

QualifierToShortenInfo

data class QualifierToShortenInfo(val qualifierToShorten: SmartPsiElementPointer<KtDotQualifiedExpression>, val shortenedReference: String?)

A class to keep a KtDotQualifiedExpression to shorten and what shape the shortened result has to be. shortenedReference is the expected result of shortening in a string form. If shortenedReference is null, it means the shortening will simply delete the qualifier. Note that currently the only usage of shortenedReference is the case we have the import-alias. For example, shortenedReference will be "bar" when we shorten:

ShortenCommand

ShortenOptions

data class ShortenOptions(
    val removeThis: Boolean = false, 
    val removeThisLabels: Boolean = false, 
    val removeContextSensitiveResolutionQualifiers: Boolean = false
)

ShortenStrategy

ThisLabelToShortenInfo

data class ThisLabelToShortenInfo(val labelToShorten: SmartPsiElementPointer<KtThisExpression>)

A class with a reference to KtThisExpression with a label qualifier (KtThisExpression.labelQualifier) that can be safely removed without changing the semantics of the code.

TypeToShortenInfo

data class TypeToShortenInfo(val typeToShorten: SmartPsiElementPointer<KtUserType>, val shortenedReference: String?)

A class to keep a KtUserType to shorten and what shape the shortened result has to be. shortenedReference is the expected result of shortening in a string form. If shortenedReference is null, it means the shortening will simply delete the qualifier. Note that currently the only usage of shortenedReference is the case we have the import-alias. For example, shortenedReference will be "AliasType" when we shorten:

Properties

importingScopeContext

A KaScopeContext formed from all imports in the KtFile.

Functions

asPsiType

context(session: KaSession)
fun KaType.asPsiType(
    useSitePosition: PsiElement, 
    allowErrorTypes: Boolean, 
    mode: KaTypeMappingMode = KaTypeMappingMode.DEFAULT, 
    isAnnotationMethod: Boolean = false, 
    suppressWildcards: Boolean? = null, 
    preserveAnnotations: Boolean = true, 
    allowNonJvmPlatforms: Boolean = false
): PsiType?

Converts the given KaType to a PsiType in the context of the useSitePosition.

buildArrayType

context(session: KaSession)
fun buildArrayType(elementType: KaType, init: KaArrayTypeBuilder.() -> Unit = {}): KaType

Builds a boxed / primitive (depending on the init block) array type from the given elementType.

buildClassType

context(session: KaSession)
fun buildClassType(symbol: KaClassLikeSymbol, init: KaClassTypeBuilder.() -> Unit = {}): KaType

Builds a class type with the given class symbol.

context(session: KaSession)
fun buildClassType(classId: ClassId, init: KaClassTypeBuilder.() -> Unit = {}): KaType

Builds a class type with the given class ID.

buildStarTypeProjection

buildTypeParameterType

Builds a KaTypeParameterType with the given type parameter symbol.

buildVarargArrayType

context(session: KaSession)
fun buildVarargArrayType(elementType: KaType): KaType

Builds the underlying array type of vararg function parameter with the given elementType.

collectDiagnostics

Collects all diagnostics for the given file.

collectPossibleReferenceShortenings

context(session: KaSession)
fun collectPossibleReferenceShortenings(
    file: KtFile, 
    selection: TextRange = file.textRange, 
    shortenOptions: ShortenOptions = ShortenOptions.DEFAULT, 
    classShortenStrategy: (KaClassLikeSymbol) -> ShortenStrategy = defaultClassShortenStrategy, 
    callableShortenStrategy: (KaCallableSymbol) -> ShortenStrategy = defaultCallableShortenStrategy
): ShortenCommand

Collects possible references to shorten.

collectPossibleReferenceShorteningsInElement

context(session: KaSession)
fun collectPossibleReferenceShorteningsInElement(
    element: KtElement, 
    shortenOptions: ShortenOptions = ShortenOptions.DEFAULT, 
    classShortenStrategy: (KaClassLikeSymbol) -> ShortenStrategy = defaultClassShortenStrategy, 
    callableShortenStrategy: (KaCallableSymbol) -> ShortenStrategy = defaultCallableShortenStrategy
): ShortenCommand

Collects possible references to shorten in elements text range.

computeMissingCases

Computes the missing cases of the given KtWhenExpression.

createExtensionCandidateChecker

context(session: KaSession)
fun createExtensionCandidateChecker(
    originalFile: KtFile, 
    nameExpression: KtSimpleNameExpression, 
    explicitReceiver: KtExpression?
): KaCompletionExtensionCandidateChecker

Returns an extension applicability checker for the given context nameExpression. The function is meant to only be used for providing auto-completion for Kotlin in IntelliJ IDEA.

resolveToCall

context(session: KaSession)
fun KtElement.resolveToCall(): KaCallInfo?

Resolves the given KtElement to a KaCallInfo object. KaCallInfo either contains a successfully resolved call or an error with a list of candidate calls and a diagnostic.

resolveToCallCandidates

Returns all candidates considered during overload resolution for the call corresponding to this KtElement.

resolveToSymbol

context(session: KaSession)
fun KtReference.resolveToSymbol(): KaSymbol?

Resolves the given KtReference to a symbol.

resolveToSymbols

Resolves the given KtReference to symbols.

scopeContext

context(session: KaSession)
fun KtFile.scopeContext(position: KtElement): KaScopeContext

Computes the lexical scope context for a given position in the KtFile. The scope context includes all scopes that are relevant for the given position, together with all available implicit receivers.