rust-analyzer: VSCode - Suppress Error Toast
Feature request: Add an option to suppress all Rust Analyzer errors from bubbling up to VSCode toasts.
Each and every single Rust Analyzer crash results in a toast being displayed in VSCode. Even if you chose to ignore the toast and leave it up, repeat toasts will play an attention-grabbing animation. I love Rust, I love Rust Analyzer, I’m immensely grateful to everyone in the world that made those two possible, but the toasts are like a splinter I just can’t ignore. Maybe it’s some type of OCD, but it’s really painful 🙏 I brought this up in issue 717 as well.
“We should fix the bugs instead”
I get a deluge of popups when I’m trying to git rebase. As I would fully expect, git merge conflicts aren’t valid Rust and I don’t expect (or want) Rust Analyzer to understand them. There are an infinite number of edge cases that fit this description. Process was killed, container was closed, SSH terminated, filesystem is FUBAR… it’s impossible to fix every bug. Making the server hardened against crashes is one option (IMO probably not a great option, panics are a good way to report stack traces and handle truly unrecoverable situations ‘cleanly’). I don’t think fixing every bug is a good substitution for hiding these toasts.
“We need bug reports”
Microsoft has a guide on user telemetry for VSCode. A few hundred people opted into telemetry is orders of magnitude more useful than hoping someone opens an issue for each of the many error toasts that popup throughout the day, many of which aren’t useful because the user knows exactly why the Rust isn’t valid. This kind of stuff is largely plug-and-play too, things like Sentry.io can help you filter out non-errors (like trying to parse a git merge conflict).
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 8
- Comments: 41 (20 by maintainers)
Commits related to this issue
- Auto merge of #14283 - Veykril:error-notifs, r=Veykril Load proc-macros for rustc_private crates If the client support our server status notification there is no need to show the pop up for workspac... — committed to rust-lang/rust-analyzer by bors a year ago
- Auto merge of #14313 - Veykril:notifs, r=Veykril Make project loading errors less intrusive cc https://github.com/rust-lang/rust-analyzer/issues/14193 closes https://github.com/rust-lang/rust-analyz... — committed to rust-lang/rust-analyzer by bors a year ago
- Auto merge of #14901 - Veykril:errors, r=Veykril internal: Move flycheck and config errors to status notification cc https://github.com/rust-lang/rust-analyzer/issues/14193 — committed to rust-lang/rust-analyzer by bors a year ago
- Auto merge of #15846 - jprochazk:disable-error-notification, r=Veykril editor/code: add option to suppress error notifications Fixes https://github.com/rust-lang/rust-analyzer/issues/14193 - Added ... — committed to rust-lang/rust-analyzer by bors 7 months ago
I’ll try my best to nudge this back on rails again. Seems this issue is a real hot potato 🫤
@dzdrav We all love Rust Analyzer and are grateful for the work done on it, this issue is self-evident that fact; we put up with something that really bothers us because the tool is so important and wonderful. I know this issue is frustrating, but your first post reads as entitled and derogatory, intended or not.
But tone aside… @dzdrav does also hit the nail on the head.
R-A devs… that’s the underlying theme and frustration with this issue and all the others like it. It’s the same message I’ve repeated over, and over, and over again. I’m asking that an option to be added to disable all error toasts, nothing else. Everything else (telemetry, bug-fixes, filtering, et. al) is out of scope and shouldn’t hold up this issue. They are all important, but they are all out of scope.
$50 Bounty
I’m charging tactic… who ever gets this issue fixed and deployed, gets a Venmo/Zelle transfer from me, for $50 USD. If anyone else wants to chip in a bounty I’m sure that will speed up the process.
@jprochazk Done Thank you so much, you’ve made at least one developer incredibly happy ❤️
@AThilenius
I have decided the only real workaround is either sticky notes, or this:
(Double right-click on a relaxing video in Youtube and click on picture-in-picture)
Alright, I did a second pass through things, with #14901 there are only 2 cases where the server itself sends a error/warning pop up request:
But there is actually a third error pop up that can occur, that is not from a request of the server to the client, but instead when the server responds to a client request with an error (as is the case for panics). VSCode screams at the user in this case that a request has failed,
I’ll look into whether thats configurable/hookable on the client code but if not I would consider that a VSCode “feature” or whatever sincethat handling is out of our hands (and I refuse to add a flag to make the server not report errors to the client, raise that problem upstream on the VSCode repo then). AssumingDo not disturb modedoes not make VSCode ignore LSP request errors, I’d consider that part a VSCode bug.Quoting the original comment:
If there is an option to disable popups, then what happens when they’re enabled would be another discussion. The main point of Do Not Disturb mode is to avoid disturbances such as those.
That was not my aim to imply, but the main impression from the discussion was the adament stance to “decide which popups to show” or “fix the reason” some of them are showing, which just goes around the issue of having a toggle for them.
I would be happy to take a look if you could guide me to the relevant code (and if we agree that it could be configurable as an option).
@AThilenius Thanks for writing this up!
Adding one more use case:
I work on a monorepo of tens of crates that use
build.rsto edit other crates before building as well, relying on Cargo incrementability. When developing/editing these build scripts, fly-check will often run them, and possibly produce intermediate/broken output, which fails loading other crates downstream.This makes the notification boxes (and the distraction they cause) almost constant for us.
cc @Veykril, if I may suggest, I want to think about how we can eliminate notification boxes all together, instead of trying to figure out how to show it less frequently. Notifications should be reserved for:
Workspace loading, build scripts, and fly-check issues should not be triggering notifications IMO, given how distracting they are. I wonder if we can use the
vscode.languages.createLanguageStatusItem()API, replacing both notification boxes, and the current status bar item.IIUC, this also has the following additional benefits:
@flodiebold Thing is, we already have this feature:
I can get full information just by hovering over that button in VSCode.
But in addition to that, I also get this:
Notice how it overlaps my project explorer, stealing screen space as the errors pile up.
I can reproduce this issue by renaming a
lib.rstoanything_else.rsin a multi-crate workspace.Completely agree, these should be displayed as some kind of persistent error state instead of a notification.
I think everyone here fully understands that the correct reaction to these errors is fixing them. This isn’t about fixing rust-analyzer errors. This is about using telemetry to report these errors directly to people who are better equipped to do something about it, instead of passing it to the user and hoping they do that manually or try and fix it themselves.
Most people would simply dismiss these errors since it’s very difficult (at least for me) to shift one’s focus from solving a complicated programming problem to debugging rust-analyzer. So more often than not, the error message just serves to annoy the user and not provide any actual value.