Uh oh!
There was an error while loading. Please reload this page.
Refactor internal suggestion API - #45741
Conversation
estebank
left a comment
There was a problem hiding this comment.
Overall, LGTM, intrigued about the reason to highlight trailing whitespace as well, as to my eyes it doesn't improve understanding but makes it slightly uglier.
| &[(suggestion.msg.to_owned(), Style::NoStyle)], | ||
| max_line_num_len, | ||
| "suggestion", | ||
| Some(Style::HeaderMsg)); |
| // entirety of the code being shown and the displayed code is not multiline. | ||
| if show_underline { | ||
| draw_col_separator(&mut buffer, row_num, max_line_num_len + 1); | ||
| let sub_len = sub.trim_right().len(); |
There was a problem hiding this comment.
To other reviewers, this line's change is the one that causes the output change.
| // entirety of the code being shown and the displayed code is not multiline. | ||
| if show_underline { | ||
| draw_col_separator(&mut buffer, row_num, max_line_num_len + 1); | ||
| let sub_len = parts[0].snippet.len(); |
There was a problem hiding this comment.
Is there a reason to include trailing whitespace in the suggestions? I feel it looks slightly cleaner when looking at it in the terminal as it is pointing at the code you need to write only, while it is still there for the RLS to suggest the properly formatted code.
There was a problem hiding this comment.
I thought it was less correct, but you're right, there's no gain in knowing about the whitespace in the terminal output. I'll fix it.
Changed PR so it makes no observable changes |
estebank
commented
Nov 6, 2017
@bors r+ |
bors
commented
Nov 6, 2017
📌 Commit dfe218a has been approved by |
bors
commented
Nov 9, 2017
⌛ Testing commit dfe218a with merge 5fe86f5eae8219fe3686b8556a85cf42c7219543... |
bors
commented
Nov 9, 2017
💔 Test failed - status-travis |
estebank
commented
Nov 9, 2017
@bors retry |
bors
commented
Nov 9, 2017
⌛ Testing commit dfe218a with merge a5067b6da8535c817900984f495130fe3842e5d9... |
bors
commented
Nov 9, 2017
💔 Test failed - status-travis |
kennytm
commented
Nov 9, 2017
@bors retry — travis-ci/travis-ci#8728 |
bors
commented
Nov 9, 2017
Refactor internal suggestion API ~~The only functional change is that whitespace, which is suggested to be added, also gets `^^^^` under it. An example is shown in the tests (the only test that changed).~~ Continuation of #41876 r? @nagisa the changes are probably best viewed [without whitespace](https://github.com/rust-lang/rust/pull/45741/files?w=1)
bors
commented
Nov 9, 2017
☀️ Test successful - status-appveyor, status-travis |
The only functional change is that whitespace, which is suggested to be added, also gets^^^^under it. An example is shown in the tests (the only test that changed).Continuation of #41876
r? @nagisa
the changes are probably best viewed without whitespace