ZIm/crates/zed/src
Max Brunsfeld 7ae5ee699f
Debounce code action and document highlight requests (#2905)
Lately, I've been finding Rust-analyzer unusably slow when editing large
files (like `editor_tests.rs`, or `integration_tests.rs`). When I
profile the Rust-analyzer process, I see that it sometimes saturates up
to 10 cores processing a queue of code actions requests.

Additionally, sometimes when collaborating on large files like these, we
see long delays in propagating buffer operations. I'm still not sure why
this is happening, but whenever I look at the server logs in Datadog, I
see that there are remote `CodeActions` and `DocumentHighlights`
messages being processed that take upwards of 30 seconds. I think what
may be happening is that many such requests are resolving at once, and
the responses are taking up too much of the host's bandwidth.

I think that both of these problems are caused by us sending way too
many code action and document highlight requests to rust-analyzer. This
PR adds a simple debounce between changing selections and making these
requests.

From my local testing, this debounce makes Rust-analyzer *much* more
responsive when moving the cursor around a large file like
`editor_tests.rs`.
2023-08-29 09:30:36 -07:00
..
languages language: Make Buffer::new take an explicit ID (#2900) 2023-08-28 11:51:50 +02:00
assets.rs Add basic sound handling infrastructure 2023-06-30 16:10:49 -07:00
languages.rs Merge branch 'main' into quinn/nix 2023-07-25 11:34:57 -07:00
main.rs chore: Use IsTerminal trait instead of relying on libc to detect stdout being a terminal (#2908) 2023-08-29 15:56:50 +02:00
menus.rs Add key binding to close all docks 2023-07-21 02:44:44 -04:00
only_instance.rs Avoid checking for duplicate instance when local DB is disabled 2023-07-07 14:20:39 -04:00
test.rs Remove AppState from workspace actions 2022-05-19 14:37:26 -07:00
zed.rs Update some tests to reflect code action debouncing 2023-08-28 17:45:32 -07:00