-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Diagnostics Revamp Roadmap #51528
Comments
Just when I added support for the current API in rustdoc... 😢 |
This comment has been minimized.
This comment has been minimized.
I think the way to introduce next generation systems like |
That... is an absolutely awesome idea. We can totally recreate the diagnostics API in an external crate. Even better: we can also do that for the diagnostics emitter! |
Factoring out the diagnostics emitter has a real use-case in cargo. There have been a few attempts at making a nicer build progress bar (rust-lang/cargo#3451, rust-lang/cargo#5620), but issues like rust-lang/cargo#5695 prevent the feature from being a nice user experience: the progress bar output gets interleaved with rustc output. This could be fixed if cargo were able to capture output from rustc and print it itself, but as it stands, cargo cannot capture output from rustc without losing formatting. However, if the diagnostics emitter were factored out into a third-party crate, it might be possible for cargo to recreate the errors and output them with full formatting. |
@euclio that would require |
Over on Zulip we were recently discussing the idea of having a fallback "footnote" mode to use for overlapping, adjacent, or malordered labels. I wrote up the idea in this gist: https://gist.github.com/nikomatsakis/80866d4407f1cc38fba0c2da7175dcf7 Example might be like:
instead of
(The proposal also includes a way to indicate labels that have an "ordering" to them that you would like the renderer to enforce.) |
Does the WG have any plans for internationalization support? |
We haven't discussed it but I feel that at this point we won't be able to maintain the level of quality we want while also scaffolding i10n support. I would love to hear others opinions. Cc @rust-lang/wg-diagnostics |
I think extracting diagnostics logic to structs and such is a great move for internationalization. Beyond that, the only think I would suggest is that you consider what i10n support in the future might take and try to avoid doing things that would make i10n harder in the future. Perhaps consider future-proofing traits and such today if possible. |
We discussed i18n in the wg-diagnostics Zulip channel. It becomes quite easy to migrate if we use a custom derive (or other plugin) to autogenerate AsError impls for diagnostics structs. We should start looking into getting that derive working and convert diagnostics to it. Once a significant portion of the codebase is using AsError, we can start playing with Fluent. |
Visited during the compiler team tracking issue triage meeting. We believe most of this work has been completed already and there are various other |
The current diagnostics APIs are very unergonomic and can result in various verbose, repetitive and annoying code snippets.
cc @estebank
emit
method--teach
APIThe text was updated successfully, but these errors were encountered: