org.jetbrains.kotlin.analysis.api.components¶
Types¶
KaAnalysisScopeProvider¶
@SubclassOptInRequired(markerClass = [KaSessionComponentImplementationDetail::class])
interface KaAnalysisScopeProvider : KaSessionComponent
KaArrayTypeBuilder¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaArrayTypeBuilder : KaTypeBuilder
A builder for array types.
KaBuiltinFunctionTypeFamilies¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaBuiltinFunctionTypeFamilies : KaBuiltinFunctionTypeFamilies
The type has been moved to a new package. Use <strong>org.jetbrains.kotlin.analysis.api.types.KaBuiltinFunctionTypeFamilies</strong> instead.
KaBuiltinTypes¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
abstract class KaBuiltinTypes : KaBuiltinTypes
The type has been moved to a new package. Use <strong>org.jetbrains.kotlin.analysis.api.types.KaBuiltinTypes</strong> instead.
KaCallableImplementationState¶
sealed interface KaCallableImplementationState
The type has been moved to a new package. Use <strong>org.jetbrains.kotlin.analysis.api.symbols.KaCallableImplementationState</strong> instead.
KaClassTypeBuilder¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaClassTypeBuilder : KaTypeBuilder
A builder for class types.
KaCodeCompilationException¶
class KaCodeCompilationException(cause: Throwable) : RuntimeException
The type has been moved to a new package. Use <strong>org.jetbrains.kotlin.analysis.api.compilation.KaCodeCompilationException</strong> instead.
KaCompilationOptions¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaCompilationOptions : KaCompilationOptions
The type has been moved to a new package. Use <strong>org.jetbrains.kotlin.analysis.api.compilation.KaCompilationOptions</strong> instead.
KaCompilationOptionsBuilder¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaCompilationOptionsBuilder : KaCompilationOptionsBuilder
The type has been moved to a new package. Use <strong>org.jetbrains.kotlin.analysis.api.compilation.KaCompilationOptionsBuilder</strong> instead.
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¶
enum class KaCompilationTarget : Enum<KaCompilationTarget>
The type has been moved to a new package. Use <strong>org.jetbrains.kotlin.analysis.api.compilation.KaCompilationTarget</strong> instead.
KaCompiledClassHandler¶
fun interface KaCompiledClassHandler : KaCompiledClassHandler
The type has been moved to a new package. Use <strong>org.jetbrains.kotlin.analysis.api.compilation.KaCompiledClassHandler</strong> instead.
KaCompiledFile¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaCompiledFile : KaCompiledFile
The type has been moved to a new package. Use <strong>org.jetbrains.kotlin.analysis.api.compilation.KaCompiledFile</strong> instead.
KaCompilerFacility¶
@SubclassOptInRequired(markerClass = [KaSessionComponentImplementationDetail::class])
interface KaCompilerFacility : KaSessionComponent
KaCompilerFacilityModuleActualizer¶
fun interface KaCompilerFacilityModuleActualizer
The type has been moved to a new package. Use <strong>org.jetbrains.kotlin.analysis.api.compilation.KaCompilerFacilityModuleActualizer</strong> instead.
KaCompilerPluginGeneratedDeclarations¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaCompilerPluginGeneratedDeclarations : KaCompilerPluginGeneratedDeclarations
The type has been moved to a new package. Use <strong>org.jetbrains.kotlin.analysis.api.compilerPlugins.KaCompilerPluginGeneratedDeclarations</strong> instead.
KaCompilerPluginGeneratedDeclarationsProvider¶
@SubclassOptInRequired(markerClass = [KaSessionComponentImplementationDetail::class])
interface KaCompilerPluginGeneratedDeclarationsProvider : KaSessionComponent
Provides declarations generated by compiler plugins.
KaCompletionCandidateChecker¶
@SubclassOptInRequired(markerClass = [KaSessionComponentImplementationDetail::class])
interface KaCompletionCandidateChecker : KaSessionComponent
KaCompletionExtensionCandidateChecker¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaCompletionExtensionCandidateChecker : KaLifetimeOwner
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>
)
The type has been moved to a new package. Use <strong>org.jetbrains.kotlin.analysis.api.dataflow.KaDataFlowExitPointSnapshot</strong> instead.
KaDataFlowProvider¶
@SubclassOptInRequired(markerClass = [KaSessionComponentImplementationDetail::class])
interface KaDataFlowProvider : KaSessionComponent
KaDeprecation¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaDeprecation
The type has been moved to a new package. Use <strong>org.jetbrains.kotlin.analysis.api.symbols.KaDeprecation</strong> instead.
KaDeprecationLevel¶
class KaDeprecationLevel
The type has been moved to a new package. Use <strong>org.jetbrains.kotlin.analysis.api.symbols.KaDeprecationLevel</strong> instead.
KaDiagnosticCheckerFilter¶
enum class KaDiagnosticCheckerFilter : Enum<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¶
sealed class KaExtensionApplicabilityResult : KaLifetimeOwner
Represents the result of checking the applicability of an extension callable in a specific context.
KaFunctionTypeFamily¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaFunctionTypeFamily : KaFunctionTypeFamily
The type has been moved to a new package. Use <strong>org.jetbrains.kotlin.analysis.api.types.KaFunctionTypeFamily</strong> instead.
KaImplicitReceiver¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaImplicitReceiver : KaScopeImplicitReceiverValue
Represents an implicit receiver available in a particular context.
KaImplicitReceiverSmartCast¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaImplicitReceiverSmartCast : KaLifetimeOwner
The type has been moved to a new package. Use <strong>org.jetbrains.kotlin.analysis.api.dataflow.KaImplicitReceiverSmartCast</strong> instead.
KaImplicitReceiverSmartCastKind¶
The type has been moved to a new package. Use <strong>org.jetbrains.kotlin.analysis.api.dataflow.KaImplicitReceiverSmartCastKind</strong> instead.
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¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaScopeContext : KaLifetimeOwner
KaScopeImplicitArgumentValue¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaScopeImplicitArgumentValue : KaScopeImplicitValue
Represents an implicit argument available in a particular KaScopeContext.
KaScopeImplicitReceiverValue¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaScopeImplicitReceiverValue : KaScopeImplicitValue
Represents an implicit receiver available in a particular KaScopeContext.
KaScopeImplicitValue¶
sealed interface KaScopeImplicitValue : KaLifetimeOwner
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¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaScopeWithKind : KaLifetimeOwner
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¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaSmartCastInfo : KaSmartCastInfo
The type has been moved to a new package. Use <strong>org.jetbrains.kotlin.analysis.api.dataflow.KaSmartCastInfo</strong> instead.
KaSmartCastPossibility¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaSmartCastPossibility : KaLifetimeOwner
Represents a possible smart cast at a fixed context position.
KaSmartCastSource¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaSmartCastSource : KaLifetimeOwner
Either a symbol for which a smart cast is generated, or one of its receivers.
KaSourceProvider¶
@SubclassOptInRequired(markerClass = [KaSessionComponentImplementationDetail::class])
interface KaSourceProvider : KaSessionComponent
KaSubstitutorBuilder¶
class KaSubstitutorBuilder(val token: KaLifetimeToken) : KaSubstitutorBuilder
The type has been moved to a new package. Use <strong>org.jetbrains.kotlin.analysis.api.types.KaSubstitutorBuilder</strong> instead.
KaSubstitutorProvider¶
@SubclassOptInRequired(markerClass = [KaSessionComponentImplementationDetail::class])
interface KaSubstitutorProvider : KaSessionComponent
KaSubtypingErrorTypePolicy¶
enum class KaSubtypingErrorTypePolicy : Enum<KaSubtypingErrorTypePolicy>
The type has been moved to a new package. Use <strong>org.jetbrains.kotlin.analysis.api.types.KaSubtypingErrorTypePolicy</strong> instead.
KaSymbolInformationProvider¶
@SubclassOptInRequired(markerClass = [KaSessionComponentImplementationDetail::class])
interface KaSymbolInformationProvider : KaSessionComponent
KaSymbolRelationProvider¶
@SubclassOptInRequired(markerClass = [KaSessionComponentImplementationDetail::class])
interface KaSymbolRelationProvider : KaSessionComponent
KaTypeBuilder¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaTypeBuilder : KaLifetimeOwner
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¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaTypeParameterTypeBuilder : KaTypeBuilder
A builder for type parameter types.
KaTypeProvider¶
@SubclassOptInRequired(markerClass = [KaSessionComponentImplementationDetail::class])
interface KaTypeProvider : KaSessionComponent
KaTypeRelationChecker¶
@SubclassOptInRequired(markerClass = [KaSessionComponentImplementationDetail::class])
interface KaTypeRelationChecker : KaSessionComponent
KaUnificationSubstitutorPolicy¶
enum class KaUnificationSubstitutorPolicy : Enum<KaUnificationSubstitutorPolicy>
The type has been moved to a new package. Use <strong>org.jetbrains.kotlin.analysis.api.types.KaUnificationSubstitutorPolicy</strong> instead.
KaUseSiteVisibilityChecker¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaUseSiteVisibilityChecker : KaUseSiteVisibilityChecker
The type has been moved to a new package. Use <strong>org.jetbrains.kotlin.analysis.api.visibility.KaUseSiteVisibilityChecker</strong> instead.
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¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface ShortenCommand
ShortenOptions¶
data class ShortenOptions(
val removeThis: Boolean = false,
val removeThisLabels: Boolean = false,
val removeContextSensitiveResolutionQualifiers: Boolean = false
)
ShortenStrategy¶
enum class ShortenStrategy : Enum<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¶
context(session: KaSession)
val KtFile.importingScopeContext: KaScopeContext
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¶
context(session: KaSession)
fun buildStarTypeProjection(): KaStarTypeProjection
Builds a KaStarTypeProjection (*).
buildTypeParameterType¶
context(session: KaSession)
fun buildTypeParameterType(symbol: KaTypeParameterSymbol, init: KaTypeParameterTypeBuilder.() -> Unit = {}): KaTypeParameterType
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¶
context(session: KaSession)
fun KtFile.collectDiagnostics(filter: KaDiagnosticCheckerFilter): Collection<KaDiagnosticWithPsi<*>>
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¶
context(session: KaSession)
fun KtWhenExpression.computeMissingCases(): List<KaWhenMissingCase>
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¶
context(session: KaSession)
fun KtElement.resolveToCallCandidates(): List<KaCallCandidateInfo>
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¶
context(session: KaSession)
fun KtReference.resolveToSymbols(): Collection<KaSymbol>
Resolves the given KtReference to symbols.
scopeContext¶
context(session: KaSession)
fun KtFile.scopeContext(position: KtElement): KaScopeContext