Skip to content

KaCompletionCandidateChecker

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

Inheritors

Properties

token

abstract val token: KaLifetimeToken

The KaLifetimeToken which determines the lifetime of the lifetime owner.

Functions

assertIsValidAndAccessible

createExtensionCandidateChecker

abstract 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.

The returned checker does not cache the results for individual callable candidates.

Parameters

  • originalFile: The file being edited.

  • nameExpression: The expression under the caret in an in-memory copy of originalFile with a placeholder identifier inserted. Also see CompletionUtilCore.DUMMY_IDENTIFIER in IntelliJ IDEA.

  • explicitReceiver: A receiver expression, if available (also from the in-memory copy of originalFile).

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.