-
Notifications
You must be signed in to change notification settings - Fork 3
Description
This crate's purpose seems to heavily overlap with annotate-snippets
which is currently being merged into rustc with an intention to replace the internal snippets formatter.
I believe that there's a very high value for the ecosystem in having a general purpose library of that kind as lowers the entry barrier to providing great UX for rust apps matching the experience of using rustc itself.
At the same time, the domain is esoteric enough that I'm concerned about spreading the investment across multiple similar libraries and ending up with multiple very similar, slightly undermaintained ones.
I started evaluating language-reporting
to compare it to annotate-snippets
and I think the latter provides a cleaner API, has smaller dependency chain and it would be easier to merge language-reporting
into it than the reverse.
This is not a criticism of the language-reporting
crate, and I am prone to bias due to being an author of the annotate-snippets
- if you disagree and prefer to maintain your own crate, I will understand that. If you believe we should merge annotate-snippets
into it, I'm open to discuss it as well!
To ease the evaluation, I ported emit.rs example to use annotate-snippets: https://gist.github.com/zbraniecki/1624937ef922a66884af8b2689d928ad
You can place it in ./examples
and run with cargo run --example emit --features ansi_term
.
It's not exactly 1-1 copy, and I think language-reporting
brings features that can be merged into annotate-snippets
and has some logic that annotate-snippets
would benefit from (using writer!).
I hope this warrants a conversation starter about the role of those two crates and possibilities for unifying the effort.