-
Notifications
You must be signed in to change notification settings - Fork 33.5k
# Add column and line numbers for suggested edits #169415
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
base: main
Are you sure you want to change the base?
# Add column and line numbers for suggested edits #169415
Conversation
I think it would be great to have special handling for renames, because in those cases Ln/Col is always the same for select and insert. I would remove the insert Ln/Col so that "before" and "after" are next to each other as they are currently. I would also like to have all Ln/Col values to be horizontally aligned next to the checkbox, because that would make it easier to visually search for a specific value or range. However, I don't know how this would work in non-rename situations where the insert Ln/Col is present. |
Hey @jrieken Thanks for the quick reply & for the wait untill I came back from my Xmass vacation :) I drew the base inspiration from the Problem Panel (see below) where the Ln/Col would be explicitly called out.
Do you think there is neccessity to rather align it with the search panel? Hey @lamm45 I didn't completely understand the positioning issue you mentioned. At the moment the label is horizontally aligned with the checbox. And As far as I know the label is clipped with ellipsis if the window gets smaller (no linebreaks). |
I don't think renaming is an edge case. In fact, it is the only type of VS Code refactoring I have ever applied. I don't even know how to do any other refactoring, but apparently that would be possible with some language/extension combinations that I'm not using. To clarify, I am talking about renaming which occurs when you right-click a symbol and select "Rename Symbol" (that's also This is how the refactor preview currently works, when renaming This can be presented textually as: I was suggesting simply this (the position info in square brackets is only schematic - I'm not addressing how it should look like or whether column numbers should be shown): By horizontal alignment I mean that every position info starts from the same horizontal coordinate in the screen. Just like [2], [5] and [5] above. According to the picture in the PR, this is not always the case (only the first three position infos are aligned, whereas the fourth and fifth position infos are placed more towards the right of the screen). Placing a redundant position info between the "select" and "insert" parts would, in my opinion, unnecessarily separate those two parts and make it slightly more difficult to comprehend the changes while taking into account the surrounding context. It would also be weird if the position info for "select" is always next to the checkbox but the position info for "insert" is in another place in the middle of the text, but having both of them next to the checkbox would be even more confusing. Moreover, position info which is placed in the middle of the text (as opposed to the proximity of the checkbox) may cause confusion if whitespaces are involved (either in the renamed text or adjacent to the renamed text). Currently, whitespaces are very easily recognized since the preview does not add any extra whitespaces in the middle of the text, as can be seen from the image above. Either way, I'm going to use this feature, because having no line numbers for the rename preview is by far the worst option. I wonder why they haven't been added before. |
Hey @lamm45, Thank you very much for the detailed response, I very much appreciate it. You indeed raise a good point. I agree that for the case of renames, adding the So I see these ways forward:
@jrieken do you have a strong opinion about using the |
This PR addresses the addition of column & line numbers to the Refactor Preview.
[Ln x Col x]
only for parts of edit that contain select/insert (not rendered for prefixes to declutter ui) (see image below)Technical notes:
string
inserted or selected. This makes it easier for the label generation to directly generate the[Ln x Col x]
only on defined ranges.Fixes #165759