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¶
interface KaSourceModificationService : KaEngineService
KaSourceModificationService is an engine service which handles cache invalidation after source code changes:
KotlinCodeFragmentContextModificationEvent¶
class KotlinCodeFragmentContextModificationEvent(val module: KaModule) : KotlinModificationEvent
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¶
KotlinGlobalSourceOutOfBlockModificationEvent signals that out-of-block modification is occurring possibly globally.
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¶
enum class KotlinModificationEventKind : Enum<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¶
fun interface 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¶
class KotlinModuleOutOfBlockModificationEvent(val module: KaModule) : KotlinModificationEvent
This event signals that an out-of-block modification is occurring in the sources of module.
KotlinModuleStateModificationEvent¶
class KotlinModuleStateModificationEvent(val module: KaModule, val modificationKind: KotlinModuleStateModificationKind) : KotlinModificationEvent
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¶
Publishes a KotlinCodeFragmentContextModificationEvent for this KaModule. Must be called in a write action.
publishGlobalModuleStateModificationEvent¶
fun Project.publishGlobalModuleStateModificationEvent()
Publishes a KotlinGlobalModuleStateModificationEvent. Must be called in a write action.
publishGlobalScriptModuleStateModificationEvent¶
fun Project.publishGlobalScriptModuleStateModificationEvent()
Publishes a KotlinGlobalScriptModuleStateModificationEvent. Must be called in a write action.
publishGlobalSourceModuleStateModificationEvent¶
fun Project.publishGlobalSourceModuleStateModificationEvent()
Publishes a KotlinGlobalSourceModuleStateModificationEvent. Must be called in a write action.
publishGlobalSourceOutOfBlockModificationEvent¶
fun Project.publishGlobalSourceOutOfBlockModificationEvent()
Publishes a KotlinGlobalSourceOutOfBlockModificationEvent. Must be called in a write action.
publishModificationEvent¶
fun Project.publishModificationEvent(event: KotlinModificationEvent)
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¶
fun KaModule.publishModuleStateModificationEvent(modificationKind: KotlinModuleStateModificationKind)
Publishes a KotlinModuleStateModificationEvent for this KaModule. Must be called in a write action.