-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Wrong coloring on "consider removing this method call" #134485
Comments
why didnt you just give the part that had the incorrect color... but anyways thats kinda weird |
I suspect it's the suggestion using some replacement span which is not quite accurate to the syntax. |
The issue is that the highlighting logic doesn't account for "the removed snippet is multiline". We need to look for newlines in the Thank you for the report! I've noticed some highlights being off, but never managed to capture a good repro when encountering them. This is very useful! |
When highlighting the removed parts of a suggestion, properly account for spans that cover more than one line. Fix rust-lang#134485.
When highlighting the removed parts of a suggestion, properly account for spans that cover more than one line. Fix rust-lang#134485.
When highlighting the removed parts of a suggestion, properly account for spans that cover more than one line. Fix rust-lang#134485.
When highlighting the removed parts of a suggestion, properly account for spans that cover more than one line. Fix rust-lang#134485.
When highlighting the removed parts of a suggestion, properly account for spans that cover more than one line. Fix rust-lang#134485.
…ouxu Account for removal of multiline span in suggestion When highlighting the removed parts of a suggestion, properly account for spans that cover more than one line. Fix rust-lang#134485. ![Screenshot of the highlighted output](https://github.com/user-attachments/assets/18bcd9bc-3bec-4b79-a9d7-e4ea4e6289ad)
…ouxu Account for removal of multiline span in suggestion When highlighting the removed parts of a suggestion, properly account for spans that cover more than one line. Fix rust-lang#134485. ![Screenshot of the highlighted output](https://github.com/user-attachments/assets/18bcd9bc-3bec-4b79-a9d7-e4ea4e6289ad)
Rollup merge of rust-lang#134664 - estebank:sugg-highlighting, r=jieyouxu Account for removal of multiline span in suggestion When highlighting the removed parts of a suggestion, properly account for spans that cover more than one line. Fix rust-lang#134485. ![Screenshot of the highlighted output](https://github.com/user-attachments/assets/18bcd9bc-3bec-4b79-a9d7-e4ea4e6289ad)
…ouxu Account for removal of multiline span in suggestion When highlighting the removed parts of a suggestion, properly account for spans that cover more than one line. Fix rust-lang#134485. ![Screenshot of the highlighted output](https://github.com/user-attachments/assets/18bcd9bc-3bec-4b79-a9d7-e4ea4e6289ad)
Consider this code:
It gives:
My bug report is about the coloring in this particular suggestion:
removing the red parts will obviously make the situation worse and cause parsing errors.
Even if you remove the entire
map
function call, it won't fix all the errors, what is needed is the removal offlatten
. I want to make this particular issue about the wrong coloring of that red part: there is some mistake about it.Appears on latest nightly
rustc 1.85.0-nightly (a4cb3c831 2024-12-17)
as well as betarustc 1.84.0-beta.4 (202008a1b 2024-12-07)
.The text was updated successfully, but these errors were encountered: