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

Deprecate in favor of annotate-snippets-rs? #9

Open
kevinmehall opened this issue Jul 14, 2019 · 2 comments
Open

Deprecate in favor of annotate-snippets-rs? #9

kevinmehall opened this issue Jul 14, 2019 · 2 comments

Comments

@kevinmehall
Copy link
Owner

I noticed that rustc is breaking out its error formatting into a reusable library called annotate-snippets-rs.

The API seems slightly lower level (e.g. explicitly choosing what portion of the source to display), but the code is much more readable.

I'm not sure it makes sense to continue maintaining a fork of rustc's old error formatting code if they're replacing it with an external library.

@Lymia
Copy link

Lymia commented Jul 15, 2019

It looks like this library is enough to cover the same use cases as codemap-diagnostic, yeah. A convenience layer over it and codemap might still be useful, but #7 is probably unnecessary then. (Since it isn't too big of a deal to implement your own at that point.)

@kevinmehall
Copy link
Owner Author

2023 update:

  • Annotate-snippets-rs is included in rustc behind a non-default flag, but there doesn't seem to be much movement towards it replacing rustc's emitter.rs as the default.
  • I've switched my signalspec project to use codespan-reporting so I'm no longer using this crate myself
    • codespan-reporting itself seems slightly under-maintained, but is much simpler, more readable code, has tests, and more widely used than codemap-diagnostic. So if I'm going to maintain something it's probably better for me to help out there.
  • A few new contenders have appeared for diagnostic reporting that look good

So I'm inclined to recommend any of those instead. I'm releasing v0.1.2 with a few accumulated fixes and a deprecation message.

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

No branches or pull requests

2 participants