Repository navigation
perf: Use ProgressIndicatorUtils.awaitWithCheckCanceled - #1649
Merged
angelozerr merged 1 commit intoAug 28, 2026
Merged
angelozerr merged 1 commit into
angelozerr merged 1 commit into
Conversation
angelozerr
force-pushed
the
_ProgressIndicatorUtils.awaitWithCheckCanceled(
branch
from
August 28, 2026 14:16
c9bc6e0 to
510e9c1
Compare
angelozerr
force-pushed
the
_ProgressIndicatorUtils.awaitWithCheckCanceled(
branch
from
August 28, 2026 17:29
510e9c1 to
8c95cf0
Compare
Signed-off-by: azerr <[email protected]>
angelozerr
force-pushed
the
_ProgressIndicatorUtils.awaitWithCheckCanceled(
branch
from
August 28, 2026 19:43
8c95cf0 to
57b367f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CompletableFutures.waitUntilDone()polledfuture.get(25ms)in a tight loop while holding a ReadAction. When the LSP server was slow to respond, this blocked all pending WriteActions (document modifications, Git Push dialog, etc.), causing a cascade:textDocument/didChange(needs WriteAction to update document) → server never respondsFix
Replace all
waitUntilDone()calls withProgressIndicatorUtils.awaitWithCheckCanceled(future)— the correct IntelliJ API that cooperates with the ReadAction/WriteAction protocol:awaitWithCheckCanceleddetects the cancellation → throwsProcessCanceledExceptionChanges (51 files, -710 lines)
Core cleanup:
waitUntilDone()(3 overloads) —PsiFileChangedException— only used bywaitUntilDone, superseded by IntelliJ's ProgressIndicatorcancellation on WriteAction
SafetyTimeoutException— only used bywaitUntilDonewaitUntilDoneAsync()to useProCheckCanceledinternally (used by renamehandler)Migration (40 call sites):
Special case — WriteAction context:
LSPServerSideOnTypeFormattingHelper: usesfuture.get(500ms)directly (no ProgressIndicator in WriteAction, timeout is the guard)