IJPL-248392 LSP: rename LspDocumentSyncManager.dispose -> shutdown

(cherry picked from commit 93675422432e0d8c634c2bee1290289bbb4860ab)

IJ-CR-210268

GitOrigin-RevId: 7f182e7a1d57f3ff198e958b788e268f7c6f6c61
This commit is contained in:
Piotr Tomiak
2026-08-19 18:48:46 +00:00
committed by intellij-monorepo-bot
parent d4294bc008
commit 626818b4b5
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -293,7 +293,7 @@ class LspClientImpl internal constructor(
LspInlayApplier.getInstance(project).scheduleRefresh(file)
}
}
documentSyncManager.dispose()
documentSyncManager.shutdown()
requestExecutor.shutdownNow()
serverNotificationsHandler.cancelAllProgress()
@@ -34,7 +34,7 @@ import java.util.concurrent.atomic.AtomicBoolean
internal class LspDocumentSyncManager(private val client: LspClientImpl) {
private val openedFiles: MutableSet<VirtualFile> = Collections.synchronizedSet(HashSet())
private val disposed = AtomicBoolean(false)
private val shutdown = AtomicBoolean(false)
val openedFileCount: Int get() = openedFiles.size
@@ -45,9 +45,9 @@ internal class LspDocumentSyncManager(private val client: LspClientImpl) {
fun forEachOpenedFile(action: (VirtualFile) -> Unit) = openedFiles.forEach(action)
fun dispose() {
fun shutdown() {
openedFiles.clear()
disposed.set(true)
shutdown.set(true)
}
@RequiresWriteLock
@@ -56,7 +56,7 @@ internal class LspDocumentSyncManager(private val client: LspClientImpl) {
// Error should not be logged if the sync manager is disposed of, as the server state
// and thus sync manager state might have changed just after entering `open` method
// and caller is not able to sync on the server state
if (!disposed.get()) {
if (!shutdown.get()) {
client.logError("Server is not in the Running state. Ignoring open($file)")
}
return
@@ -85,7 +85,7 @@ internal class LspDocumentSyncManager(private val client: LspClientImpl) {
// Error should not be logged if the sync manager is disposed of, as the server state
// and thus sync manager state might have changed just after entering `open` method
// and caller is not able to sync on the server state
if (!disposed.get()) {
if (!shutdown.get()) {
client.logError("close() cannot be called for files that haven't been opened. Ignoring: $file")
}
return