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

Improve crate error spans #136

Open
Jake-Shadle opened this issue Feb 13, 2020 · 4 comments
Open

Improve crate error spans #136

Jake-Shadle opened this issue Feb 13, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@Jake-Shadle
Copy link
Member

Currently, if a diagnostic pertains to a specific crate (or crates in the case of duplicates), the primary label for it is usually the entry in a synthesized lockfile, which is just the name, version, and source of the crate in question. This isn't really terribly useful, it was mainly done this way due the requirement of codespan_reporting to have a primary label for a "source" span. A better way to display such diagnostics would be to instead follow the dependency links to a root crate(s) in the workspace, and use the line in that crate's cargo manifest that included the crate in question transitively as the primary label, and if additional crates in the workspace at the same level as that root also depend on it, adding those as additional labels. For most projects this will be a more meaningful primary label than the current output.

@Jake-Shadle Jake-Shadle added the enhancement New feature or request label Feb 13, 2020
@Jake-Shadle
Copy link
Member Author

Oh, this would also probably include things like using the license expression as it appears in the cargo manifest as well, rather than the synthesized one we use now.

@brendanzab
Copy link

I just noticed that cargo-deny uses codespan! As a heads-up, in the next version we won't require a primary span, so hopefully this makes things easier for you!

@Jake-Shadle
Copy link
Member Author

Nice, looking forward to it! Codespan is a great library!

@brendanzab
Copy link

Getting ready to release 0.9.0! brendanzab/codespan#199

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

No branches or pull requests

2 participants