-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include rustc diagnostic ASCII art in popup #13574
Comments
So unfortunately, diagnostic popups don't permit markdown, but it is rendered in a monospace font so that should be fine. The other problem though is that the handling of rustc diagnostics is a mess (the |
I recall having read the docs some time back that markdown was allowed in popups, but it might have been on custom popups, which I wouldn't want to burden you with trying to get working, this was meant as a "fast an easy" win.
Yeah, it has to encode too much info and it wasn't designed, it just grew.
note and help blocks.
The primary spans are those that are underlined in red in the main subdiagnostic (and in cyan or yellow in help, notes and warnings), while the secondary spans are all the ones underlined in color blue. The primary span is where the error actually is, and the others "merely" provide context. There can be more than one primary span because we try to underline as little as possible, so if we have an error of
For that meeting, I would love it if you could show some good example of a complex diagnostic, like a trait object safety or trait bound error to give them context on what our requirements can be. |
Currently rust-analyzer leverages the structured json output from rustc when presenting diagnostics from rustc. This is great because it translates the provided spans into links that people can click to get to the right place, but removes sometimes critical context (from both newcomers and experts alike).
The rustc ASCII art output isn't perfect, and the one provided by the json output doesn't provide formatting information, and VSCode doesn't let us replicate or even improve over it without writing a full blown webview that would have to handle everything on its own and not be able to pop up in place on hover, but we can use the ASCII art, stick it in a codeblock in the current pop up and gain back some of the context back. We might want to only extend the current output, or we could replace everything but the main error message (this could even be configurable).
I think doing this, even if imperfect, is important because it happens way too often that someone comes to one of our support pages asking for help, and when asked to provide the cli output they finally notice that the solution is already provided for them.
CC @Veykril
The text was updated successfully, but these errors were encountered: