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

Span information for errors #7548

Closed
est31 opened this issue Oct 28, 2019 · 7 comments
Closed

Span information for errors #7548

est31 opened this issue Oct 28, 2019 · 7 comments
Labels
A-cargo-api Area: cargo-the-library API and internal code issues A-diagnostics Area: Error and warning messages generated by Cargo itself. C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-propose-close Status: A team member has nominated this for closing, pending further input from the team

Comments

@est31
Copy link
Member

est31 commented Oct 28, 2019

It would be cool if Cargo could supply library users with span information when there is an error. RLS for example has to underline the entire file (using vscode) becuase it has no details, even though only one dependency could have an error.

Screenshot_20191028_165522

See also rust-lang/rls#1581

The span could also be printed for CLI users, but the feature can be lib-only as well.

@est31 est31 added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Oct 28, 2019
@ehuss ehuss added A-cargo-api Area: cargo-the-library API and internal code issues A-diagnostics Area: Error and warning messages generated by Cargo itself. labels Nov 8, 2019
@epage
Copy link
Contributor

epage commented Oct 10, 2023

With RLS dead, is anyone still requesting this or should we close this?

@epage epage added the S-propose-close Status: A team member has nominated this for closing, pending further input from the team label Oct 10, 2023
@epage
Copy link
Contributor

epage commented Oct 10, 2023

Actually, this looks like a dupe of #6144, closing in favor of that. If there is some mistake, let us know!

@epage epage closed this as not planned Won't fix, can't repro, duplicate, stale Oct 10, 2023
@est31
Copy link
Member Author

est31 commented Oct 10, 2023

The span could also be printed for CLI users

In general, it would be good if cargo could start printing spans, and point users to the cause of errors.

@est31
Copy link
Member Author

est31 commented Oct 10, 2023

What I'm trying to say is, #6144 was closed as RLS related, and while this issue used RLS in its example to make it clear what the issue means to end users, it also exists just as well with rust-analyzer. In fact, there the issue is even worse, as rust-analyzer shows it as an "internal error" of sorts, instead of listing it in the compilation errors.

@epage
Copy link
Contributor

epage commented Oct 11, 2023

This issue is also scoped to cargo-as-a-library which I don't think rust-analyzer uses. Without concrete users to give feedback on a feature request (RLS being the previous one), I don't see value in keeping an issue on this open.

@epage
Copy link
Contributor

epage commented Oct 11, 2023

btw if we re-opened anything, I would expect it to be the other issue as it has more discussion on the matter (even though its not much)

@est31
Copy link
Member Author

est31 commented Oct 12, 2023

This issue is also scoped to cargo-as-a-library which I don't think rust-analyzer uses

Good point, rls uses cargo-as-a-library: https://github.com/rust-lang/rls/blob/master/Cargo.toml#L34 , but I couldn't find any library use of cargo in rust-analyzer.

Maybe it might make sense to file a new issue as the rust-analyzer case is too different, instead of repurposing the rls one. There is a lack in how nice IDEs are to users when it comes to cargo level errors. So I think an issue should be open in cargo for adding span info to diagnostics (if there isn't one already).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cargo-api Area: cargo-the-library API and internal code issues A-diagnostics Area: Error and warning messages generated by Cargo itself. C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-propose-close Status: A team member has nominated this for closing, pending further input from the team
Projects
None yet
Development

No branches or pull requests

3 participants