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

Comment widget doesn't work with inline diffs on deleted lines #164729

Closed
TheQuantumPhysicist opened this issue Oct 11, 2022 · 12 comments · Fixed by #165547
Closed

Comment widget doesn't work with inline diffs on deleted lines #164729

TheQuantumPhysicist opened this issue Oct 11, 2022 · 12 comments · Fixed by #165547
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug comments Comments Provider/Widget/Panel issues insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Milestone

Comments

@TheQuantumPhysicist
Copy link

I only found an issue about deleted files microsoft/vscode-pull-request-github#3421. Can't say this is unrelated, can't say this is the same.

  • Extension version: v0.50.0
  • VSCode Version: 1.72.0
  • OS: Debian 11.5

Steps to Reproduce:

  1. Create a pull request that removes code
  2. Open the pull request in VSCode, and view the file with deleted lines
  3. Attempt to add a comment on a deleted line in diff-view, you can't. The "plus" sign doesn't show to add a comment on deleted lines.
  4. Even worse, if someone does it on github and adds a comment, it's not possible to view them properly on VSCode, and basically VSCode shows an empty file with the comment
@alexr00 alexr00 self-assigned this Oct 18, 2022
@alexr00 alexr00 added the bug Issue identified by VS Code Team member as probable bug label Oct 18, 2022
@alexr00
Copy link
Member

alexr00 commented Oct 24, 2022

Open the pull request in VSCode, and view the file with deleted lines

Where are you opening the file from? Do you have the pull request checked out? If you see this with a pull request in a public repo, can you share a link to the pull request?

@alexr00 alexr00 added the info-needed Issue requires more information from poster label Oct 24, 2022
@TheQuantumPhysicist
Copy link
Author

Thank you for taking a look at this issue. I honestly don't understand why more info is needed. I'm wondering whether you faced zero issues on your part? I don't know.

Regardless, I created a test project for this: https://github.com/TheQuantumPhysicist/VSCodePRBug

And there's a PR where I removed a line. I checked out the PR in VSCode:

  • Observation No.1: If you go to the left and click on "Github Pull Request", you'll see the main.rs file that's been modified in the PR. Click on it, and you won't see the comment appearing besides the line number (which is usually the case when you add comments on added lines).
  • Observation No. 2: You can't add a comment over the old line number 3 (the red one), even though it's possible on github (which is what I did in github, and it's not viewable in VSCode). You can add a comment on the green line (which is normal behavior on both github and VSCode).
  • Observation No. 3: If you go to the comments section at the bottom, and click on the comment (as shown in this screenshot: https://imgur.com/a/YLdFxHW ), a mess will happen. I was able to see the comment once on a temporary page and I didn't understand what happened, but then ever since, I see the mess you see in the screenshot.

Basically, anything you try to do with deleted lines is a mess. Trying to add comments on them in VSCode doesn't work. Reading comments from them that were added on github doesn't work.

All the best.

@TheQuantumPhysicist
Copy link
Author

I added you to that repo.

@alexr00
Copy link
Member

alexr00 commented Oct 25, 2022

I'm wondering whether you faced zero issues on your part

Correct, I faced no issues leaving and viewing comments on deleted lines. Thank you for the example repo, I'm looking into it.

@TheQuantumPhysicist
Copy link
Author

Btw, the same issue also exists for a deleted file. So, a comment on a deleted file also doesn't show up in VSCode. This just happened with me today.

@alexr00
Copy link
Member

alexr00 commented Oct 26, 2022

Thank you for all the details! With your screen shot I can see what the problem is. The comments widget doesn't work at all on deleted lines with the inline diff editor. Setting the following setting will get this working for you: "diffEditor.renderSideBySide": true.

This is a nasty bug in VS Code, which I plan to fix in November.

@alexr00 alexr00 removed the info-needed Issue requires more information from poster label Oct 26, 2022
@alexr00 alexr00 transferred this issue from microsoft/vscode-pull-request-github Oct 26, 2022
@alexr00 alexr00 added the comments Comments Provider/Widget/Panel issues label Oct 26, 2022
@alexr00 alexr00 added this to the November 2022 milestone Oct 26, 2022
@alexr00 alexr00 changed the title Cannot comment on deleted lines or even track them in diff view in VSCode Comment widget doesn't work with inline diffs on deleted lines Oct 26, 2022
@microsoft microsoft deleted a comment from VSCodeTriageBot Oct 26, 2022
@alexr00
Copy link
Member

alexr00 commented Nov 4, 2022

I've completely disabled commenting for the left hand side of the diff editor when "diffEditor.renderSideBySide": false. Commenting is only supported when side by side is enabled.

@VSCodeTriageBot VSCodeTriageBot added the unreleased Patch has not yet been released in VS Code Insiders label Nov 4, 2022
@TheQuantumPhysicist
Copy link
Author

I've completely disabled commenting for the left hand side of the diff editor when "diffEditor.renderSideBySide": false. Commenting is only supported when side by side is enabled.

OMG... why would you do that? Now I can't review anymore! I don't use side-by-side ever... now I'm wishing I never reported this bug!

@TheQuantumPhysicist
Copy link
Author

TheQuantumPhysicist commented Nov 4, 2022

Just to be clear, with all due respect. This isn't a solution, and I would appreciate you reverting whatever you did. Believe me, no one appreciates this.

So previously I could comment on non-deleted lines, now I can't at all, unless I split the screen in a way that isn't convenient for my setup. I'm sorry but if I'm getting this right, then the least I can call this is crazy and if someone in my team does that they would be in trouble (no offense,
I'm just being 100% honest), and I will assure you other issue(s) will be opened about this. Please just revert the changes that have been done in the name of making an incomplete fix and an imperfect perfection, and postpone fixing the issue until you can fix it properly.

I really thank you for the great work you're doing, but this is crossing the line. Apologies for being harsh, but I'm shocked.

@alexr00
Copy link
Member

alexr00 commented Nov 4, 2022

@TheQuantumPhysicist commenting is only disabled on the left hand side of the diff editor when using inline diffs. You can still comment on the right side.

@TheQuantumPhysicist
Copy link
Author

@TheQuantumPhysicist commenting is only disabled on the left hand side of the diff editor when using inline diffs. You can still comment on the right side.

Perhaps there's a misunderstanding. As long as I don't have to use split screen diff side by side view to be able to comment, then all good. Thanks again.

@VSCodeTriageBot VSCodeTriageBot added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Nov 7, 2022
@aeschli
Copy link
Contributor

aeschli commented Nov 30, 2022

Verified that you can no longer add comments for deleted lines in the inline diff view.

But found #167733

@aeschli aeschli added the verified Verification succeeded label Nov 30, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug comments Comments Provider/Widget/Panel issues insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants