Subject: 30.0.50; [EGLOT] Emacs freezes when server sends a ton of progress notifications

From: Yuan Fu <[email-masked]>
Date: Sat, 21 Oct 2023 12:10:49 -0700

X-Debbugs-CC: [email-masked]

I use rust’s language server (rust-analyzer) with eglot. And whenever I turn eglot on for a project, Emacs freezes for a good 30 seconds, busy updating the eglot progress indicator, before I can do anything. I think the reason is that the rust language server sends a ton of progress notifications, which completely blocks Emacs before it’s done.

Setting eglot-report-progress to nil doesn’t help me, presumably because eglot still needs to process the notifications.

I wonder if we can only take a sample of the progress notifications, and ignore the majority, so that Emacs is free to respond to user input?

In the same vain, I wonder if we can instruct Emacs to filter out some messages from the server at process filter level and never call into lisp for these messages, such that some particularly noisy servers (eg, typescript-language-server) won’t slow down Emacs a perceivable amount?

I attached the events log during the start up of eglot in my rust project. As you can see, it sends a dozen notifications per second.

Yuan