Skip to content

Debounce textDocument/didChange events to avoid sending too many $/progress events #10075

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jenanwise opened this issue Aug 29, 2021 · 2 comments

Comments

@jenanwise
Copy link

I'm using lsp-mode with Emacs. It sends a textDocument/didChange event with every keystroke, which causes rust-analyzer to respond with thousands of immediate $/progress events. In some clients, this can cause client performance issues (see e.g. #7590).

In my case, the issue is visual noise: lsp-mode displays each $/progress update in the modeline. These can be disabled by setting lsp-progress-function to 'ignore, but loses important information (particularly when loading a new project). See also brotzeit/rustic#251 which I believe has the same root issue.

The lsp-mode devs on discord suggested that rust-analyzer should be debouncing the textDocument/didChange events, and that a similar fix was made with clojure-lsp.

@lnicola
Copy link
Member

lnicola commented Aug 29, 2021

I don't think we want debouncing just yet because it adds latency and makes for a worse user experience.

Instead, we should stop (doing the thing that's) sending those progress messages on each keypress, like in #9922. They don't even mean what they appear to mean.

@jenanwise
Copy link
Author

Looks like 53d2050 solved it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants