You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Go to Declaration holds the read lock while it waits for textDocument/definition, freezing the IDE #2015
The freeze Report 2113215673533726720 in #2014 (LSP4IJ 0.21.0, IntelliJ IDEA 262.10968.63, at startup, IDE killed after 43 s, probable cause LONG_READ_ACTION) is a thread that waits for the reply to textDocument/definition while it holds the read lock:
Meanwhile the EDT waits for the write lock, so the IDE stays frozen until the server replies.
IntelliJ calls a GotoDeclarationHandler in a plain runReadAction under ActionUtil.underModalProgress. A write action that waits for the lock doesn't cancel that read action, so awaitWithCheckCanceled only returns when the server replies or the progress is cancelled.
In 0.30.0: unchanged. getGotoDeclarationTargets still waits at line 147, through CompletableFutures.awaitWithCheckCanceled, which 2a5d042 added to make the wait null-safe and which calls the same ProgressIndicatorUtils.awaitWithCheckCanceled. LSPDocumentLinkGotoDeclarationHandler waits the same way, at lines 75 and 139. I haven't reproduced the freeze on 0.30.0 yet.
Background: 0.20.1 bounded such waits to 2 s in a read action. #1648 removed the bound in 0.20.2, since it dropped the results of slow servers, and relies on a write action cancelling the progress, which doesn't happen in this caller.
Possible fix: bound the wait again where a write action can't cancel the read action, as here, and return no targets when the server takes longer.
Reproduced on main (0bdec3f, 0.30.0) in IntelliJ IDEA 2026.3 (IU-263.7307.200). With a language server that answers textDocument/definition after 15 s, a write action (a VFS refresh) asked for 1.5 s after Go to Declaration started waited 13.7 s, until the server answered. Without a slow request, the same write action waits 1 to 74 ms.
The UI thread kept responding here, since Go to Declaration runs under a modal progress, but everything that needs the write lock waits; in the report, the UI thread was the one waiting for it.
Activity
lagergren commentedon Nov 18, 2026
Reproduced on
main(0bdec3f, 0.30.0) in IntelliJ IDEA 2026.3 (IU-263.7307.200). With a language server that answerstextDocument/definitionafter 15 s, a write action (a VFS refresh) asked for 1.5 s after Go to Declaration started waited 13.7 s, until the server answered. Without a slow request, the same write action waits 1 to 74 ms.The UI thread kept responding here, since Go to Declaration runs under a modal progress, but everything that needs the write lock waits; in the report, the UI thread was the one waiting for it.
fix: let a write action run while Go to Declaration waits for the lan…