From 626818b4b5bd3c89e462ccd8017f8acb2cee8a8d Mon Sep 17 00:00:00 2001 From: Piotr Tomiak Date: Mon, 13 Jul 2026 19:57:29 +0200 Subject: [PATCH] IJPL-248392 LSP: rename LspDocumentSyncManager.dispose -> shutdown (cherry picked from commit 93675422432e0d8c634c2bee1290289bbb4860ab) IJ-CR-210268 GitOrigin-RevId: 7f182e7a1d57f3ff198e958b788e268f7c6f6c61 --- platform/lsp-impl/src/impl/LspClientImpl.kt | 2 +- .../src/impl/documentSync/LspDocumentSyncManager.kt | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/platform/lsp-impl/src/impl/LspClientImpl.kt b/platform/lsp-impl/src/impl/LspClientImpl.kt index 67b0f80a92ca..ca106e51d046 100644 --- a/platform/lsp-impl/src/impl/LspClientImpl.kt +++ b/platform/lsp-impl/src/impl/LspClientImpl.kt @@ -293,7 +293,7 @@ class LspClientImpl internal constructor( LspInlayApplier.getInstance(project).scheduleRefresh(file) } } - documentSyncManager.dispose() + documentSyncManager.shutdown() requestExecutor.shutdownNow() serverNotificationsHandler.cancelAllProgress() diff --git a/platform/lsp-impl/src/impl/documentSync/LspDocumentSyncManager.kt b/platform/lsp-impl/src/impl/documentSync/LspDocumentSyncManager.kt index a70989e60fb9..e073d62d5c15 100644 --- a/platform/lsp-impl/src/impl/documentSync/LspDocumentSyncManager.kt +++ b/platform/lsp-impl/src/impl/documentSync/LspDocumentSyncManager.kt @@ -34,7 +34,7 @@ import java.util.concurrent.atomic.AtomicBoolean internal class LspDocumentSyncManager(private val client: LspClientImpl) { private val openedFiles: MutableSet = 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