[AA] KT-58257 Remove global out-of-block modification events

- Out-of-block modification of stable modules is meaningless, because
  stable modules should not be affected by out-of-block modification.
  Hence, only global *source* out-of-block modification makes sense and
  global out-of-block modification events can be removed.
This commit is contained in:
Marco Pennekamp
2023-07-12 22:36:08 +02:00
committed by Space Team
parent 42c879a53c
commit 62a71b1559
5 changed files with 0 additions and 40 deletions
@@ -27,13 +27,6 @@ public abstract class KotlinGlobalModificationService {
@TestOnly
public abstract fun publishGlobalModuleStateModification()
/**
* Publishes an event of global out-of-block modification of all [KtModule]s. The event does not invalidate module state like
* [publishGlobalModuleStateModification], so some module structure-specific caches might persist.
*/
@TestOnly
public abstract fun publishGlobalOutOfBlockModification()
/**
* Publishes an event of global modification of the module state of all source [KtModule]s.
*/
@@ -24,14 +24,6 @@ public abstract class KotlinGlobalModificationServiceBase(private val project: P
project.analysisMessageBus.syncPublisher(KotlinTopics.GLOBAL_MODULE_STATE_MODIFICATION).onModification()
}
@TestOnly
override fun publishGlobalOutOfBlockModification() {
ApplicationManager.getApplication().assertWriteAccessAllowed()
incrementModificationTrackers(includeBinaryTrackers = true)
project.analysisMessageBus.syncPublisher(KotlinTopics.GLOBAL_OUT_OF_BLOCK_MODIFICATION).onModification()
}
@TestOnly
override fun publishGlobalSourceModuleStateModification() {
ApplicationManager.getApplication().assertWriteAccessAllowed()
@@ -1,17 +0,0 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.providers.topics
import org.jetbrains.kotlin.analysis.project.structure.KtModule
public fun interface KotlinGlobalOutOfBlockModificationListener {
/**
* [onModification] is invoked in a write action before or after global out-of-block modification of all [KtModule]s.
*
* This event is published to invalidate caches during/between tests.
*/
public fun onModification()
}
@@ -17,7 +17,6 @@ import org.jetbrains.kotlin.analysis.providers.analysisMessageBus
* - [KotlinModuleStateModificationListener]
* - [KotlinModuleOutOfBlockModificationListener]
* - [KotlinGlobalModuleStateModificationListener]
* - [KotlinGlobalOutOfBlockModificationListener]
* - [KotlinGlobalSourceModuleStateModificationListener]
* - [KotlinGlobalSourceOutOfBlockModificationListener]
*
@@ -47,9 +46,6 @@ public object KotlinTopics {
public val GLOBAL_MODULE_STATE_MODIFICATION: Topic<KotlinGlobalModuleStateModificationListener> =
Topic(KotlinGlobalModuleStateModificationListener::class.java, Topic.BroadcastDirection.TO_CHILDREN, true)
public val GLOBAL_OUT_OF_BLOCK_MODIFICATION: Topic<KotlinGlobalOutOfBlockModificationListener> =
Topic(KotlinGlobalOutOfBlockModificationListener::class.java, Topic.BroadcastDirection.TO_CHILDREN, true)
public val GLOBAL_SOURCE_MODULE_STATE_MODIFICATION: Topic<KotlinGlobalSourceModuleStateModificationListener> =
Topic(KotlinGlobalSourceModuleStateModificationListener::class.java, Topic.BroadcastDirection.TO_CHILDREN, true)
@@ -43,10 +43,6 @@ class LLFirSessionInvalidationService(private val project: Project) : Disposable
KotlinTopics.GLOBAL_MODULE_STATE_MODIFICATION,
KotlinGlobalModuleStateModificationListener { invalidateAll(includeStableModules = true) }
)
busConnection.subscribe(
KotlinTopics.GLOBAL_OUT_OF_BLOCK_MODIFICATION,
KotlinGlobalOutOfBlockModificationListener { invalidateAll(includeStableModules = true) }
)
busConnection.subscribe(
KotlinTopics.GLOBAL_SOURCE_MODULE_STATE_MODIFICATION,
KotlinGlobalSourceModuleStateModificationListener { invalidateAll(includeStableModules = false) },