Skip to content
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

Use annotate-snippets for rustc diagnostic output #123

Open
15 tasks
nikomatsakis opened this issue Jul 22, 2024 · 3 comments
Open
15 tasks

Use annotate-snippets for rustc diagnostic output #123

nikomatsakis opened this issue Jul 22, 2024 · 3 comments

Comments

@nikomatsakis
Copy link
Contributor

Metadata
Owner(s) @estebank, @Muscraft
Team(s) compiler
Goal document 2024h2/annotate-snippets

Summary

Switch to annotate-snippets for rendering rustc's output, with no loss of functionality or visual regressions.

Tasks and status

  • Reach output parity of rustc/annotate-snippets
    • Port a subset of rustc's UI tests (@Muscraft)
    • Make list of current unnaddressed divergences (@Muscraft)
    • address divergences (@Muscraft)
  • Initial use of annotate-snippets
    • update annotate-snippets to latest version
    • teach cargo to pass annotate-snippets flag (@estebank)
    • add ui test mode comparing new output
    • switch default nightly rustc output
  • Production use of annotate-snippets
    • switch default rustc output
    • release notes
    • switch ui tests to only check new output
    • dedicated reviewer (compiler Team)
  • Standard reviews (compiler Team)
@nikomatsakis nikomatsakis added this to the 2024h2 milestone Jul 22, 2024
@rust-lang rust-lang locked and limited conversation to collaborators Jul 25, 2024
@nikomatsakis
Copy link
Contributor Author

This issue is intended for status updates only.

For general questions or comments, please contact the owner(s) directly.

@Muscraft
Copy link
Member

Muscraft commented Oct 8, 2024

The last few weeks I have been trying to get suggestions working within annotate-snippets, and have been able to match rustc suggestion output in most cases. Most of my time was spent trying to understand the different rendering styles for suggestions, and how they should be adapted to fit within annotate-snippets.

Image
Image

@Muscraft
Copy link
Member

Muscraft commented Dec 9, 2024

I have been a bit busy over the past two months, so I haven't had as much time to work on annotate-snippets as I had hoped. That said, progress was still being made!

I continued working on suggestions, but as I got deeper into the implementation, I realized getting the corner cases correct would be very difficult with the annotate-snippets architecture. I started work on a more direct translation from rustc, and quickly ended up with something that closely matched it at the cost of significant differences from how annotations are rendered. These differences, and some problems I noticed with the API for suggestions, led to a discussion with @epage about how to resolve these problems. During the discussion, I realized it would be beneficial if the internals of annotate-snippets resembled rustc as it would make it easier for contributors to rustc to contribute to annotate-snippets. @epage was helpful enough to design a new API, which resolved my suggestion API concerns and should make it easier for annotate-snippets's internals to resemble rustc. Initial work on the new design has yielded positive results, so I am hopeful this was a good decision. During all of this, I started to work on a tool that should help convert some of rustc's UI tests to be used in annotate-snippet's testsuite.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants