rust-analyzer: Duplicate diagnostic queries when pressing Enter
When I press enter (that is, add a single newline), I often see an output like this in the rust-analyzer tab, if profiling is enabled:

Looks like we process change event twice. We should figure out why is this happening. The best way to debug this would probably be:
- add
eprintlninhandlers.rsfor diagnostics, to see dupes even with profiling disabled - reproduce the effect on a small project
- enable client-side tracing (see
dev/README.mdfor instructurions) - enable logging in
main_loop
Somewhat orthogonality, we should add some debouncing for diagnostics. Ie, we should avoid producing more than one diagnostic request per 100ms, but we should immediately trigger request after a period of quiescence, and we should schedule a request to happen after 100ms anyway (this last bit might be tricky).
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 20 (20 by maintainers)
We do: https://github.com/rust-analyzer/rust-analyzer/blob/d5a1a5e6147ffdcd655ea082161bc63ac2974f2e/crates/ra_hir_ty/src/tests.rs#L250