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:

image

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 eprintln in handlers.rs for diagnostics, to see dupes even with profiling disabled
  • reproduce the effect on a small project
  • enable client-side tracing (see dev/README.md for 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)

Most upvoted comments