Skip to content

Include rustc diagnostic ASCII art in popup #13574

Closed
@estebank

Description

@estebank

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

Metadata

Metadata

Assignees

Labels

A-diagnosticsdiagnostics / error reporting

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions