mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-248392 LSP: rename LspDocumentSyncManager.dispose -> shutdown
(cherry picked from commit 93675422432e0d8c634c2bee1290289bbb4860ab) IJ-CR-210268 GitOrigin-RevId: 7f182e7a1d57f3ff198e958b788e268f7c6f6c61
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d4294bc008
commit
626818b4b5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user