-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Comments
With RLS dead, is anyone still requesting this or should we close this? |
Actually, this looks like a dupe of #6144, closing in favor of that. If there is some mistake, let us know! |
In general, it would be good if cargo could start printing spans, and point users to the cause of errors. |
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. |
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. |
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) |
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). |
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.
See also rust-lang/rls#1581
The span could also be printed for CLI users, but the feature can be lib-only as well.
The text was updated successfully, but these errors were encountered: