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

Multi-span reporting feature #28124

Closed
llogiq opened this issue Aug 31, 2015 · 2 comments · Fixed by #30411
Closed

Multi-span reporting feature #28124

llogiq opened this issue Aug 31, 2015 · 2 comments · Fixed by #30411
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@llogiq
Copy link
Contributor

llogiq commented Aug 31, 2015

For some lints, the user experience would be greatly enhanced if we could report a span with multiple highlights. E.g. in a unicode lint, we currently report every matching unicode sequence within a string, which can be very verbose.

To reduce the clutter, it would be great if we could somehow advise rustc to report the string once, but highlight a given list of spans within the string. For example, this could look like:

uni.rs:5:20: "This string contàìns multìple non nfc sequenc̀es."
                              ^^       ^                  ^

Similarly, this feature could be used with a good number of other error message to get more compact, readable output.

@jdm jdm added the A-diagnostics Area: Messages for errors, warnings, and lints label Aug 31, 2015
@Manishearth
Copy link
Member

This would be useful internally for unused imports as well.

@sanxiyn
Copy link
Member

sanxiyn commented Nov 24, 2015

See #16132 for this applied to unused imports.

bors added a commit that referenced this issue Jan 28, 2016
This allows to render multiple spans on one line, or to splice multiple replacements into a code suggestion.

fixes #28124
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants