Skip to content

org.jetbrains.kotlin.analysis.api.platform.modification

Types

KaElementModificationType

sealed interface KaElementModificationType

KaElementModificationType describes which kind of modification was applied to a changed PsiElement. KaSourceModificationService uses this information to perform change locality detection.

KaSourceModificationLocality

sealed interface KaSourceModificationLocality

KaSourceModificationLocality describes the scope of effect of a source modification detected by KaSourceModificationService.

KaSourceModificationService

KaSourceModificationService is an engine service which handles cache invalidation after source code changes:

KotlinCodeFragmentContextModificationEvent

This event signals that the context of any code fragment depending on module is changing. All code fragments depending on module, both directly or transitively, should be considered modified when this event is received.

KotlinGlobalModuleStateModificationEvent

This event signals that project settings or project structure are changing possibly globally.

KotlinGlobalScriptModuleStateModificationEvent

This event signals that Kotlin script module settings or structure are changing possibly globally.

KotlinGlobalSourceModuleStateModificationEvent

KotlinGlobalSourceModuleStateModificationEvent signals that source module settings or structure are changing possibly globally.

KotlinGlobalSourceOutOfBlockModificationEvent

KotlinModificationEvent

sealed interface KotlinModificationEvent

In the Analysis API, KotlinModificationEvents signal changes in source code, module and project settings, or project structure. These events should be subscribed to and published via the TOPIC on the Analysis API message bus. They must be published in a write action.

KotlinModificationEventKind

KotlinModificationEventKind represents the kinds of KotlinModificationEvents. While it is not required to publish or subscribe to modification events, it can be useful when abstracting over modification events in general, for example in tests.

KotlinModificationEventListener

A listener for KotlinModificationEvents. It should be registered on the analysisMessageBus with KotlinModificationEvent.TOPIC.

KotlinModificationTrackerByEventFactoryBase

abstract class KotlinModificationTrackerByEventFactoryBase(project: Project) : KotlinModificationTrackerFactory, Disposable

A base implementation of KotlinModificationTrackerFactory which defines basic modification trackers that are incremented after receiving KotlinModificationEvents.

KotlinModificationTrackerFactory

KotlinModificationTrackerFactory creates modification trackers for sources and libraries.

KotlinModuleOutOfBlockModificationEvent

This event signals that an out-of-block modification is occurring in the sources of module.

KotlinModuleStateModificationEvent

This event signals that module's settings or structure are changing. The event is published in a write action before the module is updated or removed (see KotlinModuleStateModificationKind for specifics). This allows subscribers to access the module's properties and dependencies to invalidate or update caches.

KotlinModuleStateModificationKind

Describes the kind of module state modification affecting a KaModule in more detail.

Properties

Functions

createProjectWideLibraryModificationTracker

fun Project.createProjectWideLibraryModificationTracker(): ModificationTracker

Creates a ModificationTracker which is incremented every time a library in the project is changed.

createProjectWideSourceModificationTracker

fun Project.createProjectWideSourceModificationTracker(): ModificationTracker

Creates a ModificationTracker which is incremented every time a Kotlin source file is affected by a modification, in any of the project's source modules.

publishCodeFragmentContextModificationEvent

publishGlobalModuleStateModificationEvent

Publishes a KotlinGlobalModuleStateModificationEvent. Must be called in a write action.

publishGlobalScriptModuleStateModificationEvent

Publishes a KotlinGlobalScriptModuleStateModificationEvent. Must be called in a write action.

publishGlobalSourceModuleStateModificationEvent

Publishes a KotlinGlobalSourceModuleStateModificationEvent. Must be called in a write action.

publishGlobalSourceOutOfBlockModificationEvent

Publishes a KotlinGlobalSourceOutOfBlockModificationEvent. Must be called in a write action.

publishModificationEvent

Publishes a KotlinModificationEvent to the project's analysisMessageBus. Must be called in a write action.

publishModuleOutOfBlockModificationEvent

Publishes a KotlinModuleOutOfBlockModificationEvent for this KaModule. Must be called in a write action.

publishModuleStateModificationEvent

Publishes a KotlinModuleStateModificationEvent for this KaModule. Must be called in a write action.