Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upHighlight code on diagnostics when underlined #45776
Conversation
rust-highfive
assigned
nikomatsakis
Nov 5, 2017
estebank
referenced this pull request
Nov 5, 2017
Merged
Highlight code on diagnostics when underlined #45752
estebank
added
the
S-waiting-on-review
label
Nov 5, 2017
This comment has been minimized.
This comment has been minimized.
|
Well, I'm fine with the code changes. Not sure how to make the "policy" decision. |
This comment has been minimized.
This comment has been minimized.
|
I guess I'm not sure whether -- to my eyes -- this is a net win. I find the multiple colors version to be clearer, but also kind of "Christmas Tree". The bold version is less overwhelming in that respect, but still has a lot going on. |
This comment has been minimized.
This comment has been minimized.
|
I agree with the concerns about both changes. The other option is the one laid out in #42112 (comment) to instead attempt to support thin terminals by querying the current width, I feel that the full extent of the benefits of that would be quite a bit of work, but it could be done piece-meal by adding support for specific cases. For example, code longer than terminal width with no spans falling outside of terminal would be relatively simple to implement. Should I instead focus on trying to accomplish that? |
carols10cents
added
the
T-compiler
label
Nov 13, 2017
This comment has been minimized.
This comment has been minimized.
|
@nikomatsakis ping for your thoughts! maybe do a compiler team FCP? |
This comment has been minimized.
This comment has been minimized.
|
I suppose that is a possibility. @estebank do you have a preferred path at this point, from among the many options? |
This comment has been minimized.
This comment has been minimized.
|
@nikomatsakis personally I'm partial to the Current output next to new output: |
This comment has been minimized.
This comment has been minimized.
|
I very much like the bolding here; it looks great! |
This comment has been minimized.
This comment has been minimized.
That is helpful to see it contrasted that way. |
This comment has been minimized.
This comment has been minimized.
daschl
commented
Nov 14, 2017
|
As a user I really like the bold approach because it immediately draws the (beginner) eye to the problematic code and lets one digest the messages later. |
This comment has been minimized.
This comment has been minimized.
|
@estebank - one idea we had a long time ago when we started with the new format was to highlight with the colour of the underline. Not sure why we ended up going away from it, but figured it was worth a mention here. Thanks for doing the side by side comparison. Looks okay, though iirc, some people were a little sensitive the amount of bold we were using when we first rolled that out. Will see if anyone mentions that, since I think people are now used to the "new" error message format. |
This comment has been minimized.
This comment has been minimized.
|
@jonathandturner I also had #45752 as an alternative using the underline's colors. I'm considering providing some way to configure |
This comment has been minimized.
This comment has been minimized.
|
I'm not a fan of the bolding here. I'd just prefer the text to be white instead of white and bold. I'd like Rust keywords to be bold though. |
This comment has been minimized.
This comment has been minimized.
|
@Zoxc What about black-on-white console though |
This comment has been minimized.
This comment has been minimized.
|
@kennytm Then it should be black(er). The point is that it should be highlighted by a different shade of grey and not colors. |
This comment has been minimized.
This comment has been minimized.
|
I'd encourage people leaving comments here to weigh in on the thread on users -- that thread seemed to be leaning towards the multicolored variant. |
This comment has been minimized.
This comment has been minimized.
|
(However, I think ultimately @estebank is probably right that we should just make this configurable, but default to the "clearest" variant (most easily understood), which I suspect is the multicolored one.) |
This comment has been minimized.
This comment has been minimized.
|
Triage — I am going to close this PR to keep the queue clear. As #45752 seems to be more preferred, and even if it can be made configurable, it needs to be done on top of #45752 which certainly can't just reuse this PR as-is. Therefore I see no reason keeping this PR open. @estebank feel free to reopen if you disagree. |


estebank commentedNov 5, 2017
•
edited
Highlight the label's span by bolding the corresponding code:
Fix #42112.
r? @nikomatsakis (alternative to #45752 without coloring, only highlighting)