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
The LSPInlayHintsProvider.doCollect method blocks inside a read action while waiting for the LSP to respond, and in the case of that large file, the LSP can take a long time to complete, which causes IDE stutter every time inlay hints are refreshed (every few seconds when typing)
I've found a dirty workaround for this locally by always putting the future into the pendingFutures if it's not finished, and relying on the caching behaviour of the LSPInlayHintsSupport to provide the same future once the refreshEditorFeatureWhenAllDone triggers another inlay hint pass. This fixes the EDT freeze caused by the waitUntilDone call.
As a proper fix, we could add a boolean waitUntilDoneOrTimeout(future, psiFile, int timeoutMillis, List<CompletableFuture<?>> pendingFutures) method to CompletableFutures so that inlay hints that complete fast (<50ms or similar) get done synchronously without this extra async step, but ones that take longer will get the async route.
Activity
fix: LSP inlay hint request blocks the EDT
fix: LSP inlay hint request blocks the EDT