Skip to content

KaAnalysisScopeProvider

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

Inheritors

Properties

analysisScope

abstract val analysisScope: GlobalSearchScope

A GlobalSearchScope which spans the files that can be analyzed by the current KaSession.

For example, KaSymbols can only be built for declarations which are in the analysis scope.

token

abstract val token: KaLifetimeToken

The KaLifetimeToken which determines the lifetime of the lifetime owner.

Functions

assertIsValidAndAccessible

canBeAnalysed

abstract fun PsiElement.canBeAnalysed(): Boolean

Checks whether the PsiElement is inside the analysisScope.

For example, a KaSymbol can only be built for this PsiElement if it can be analyzed.

isValid

Whether the lifetime owner is still valid, i.e. we are still in the scope of the lifetime owner's regular lifetime.

withValidityAssertion

inline fun <R> KaLifetimeOwner.withValidityAssertion(action: () -> R): R

Executes action only if the KaLifetimeOwner is still valid and accessible. Otherwise, throws a validity exception based on the concrete violation.