Skip to content

Support GitHub's suggested changes #603

Description

@Tadaboody

Github announced a new suggestion api that started being added to the code review tools.
Right now the extension takes these at face value as text.

For example take this comment.

In github:

image

In vscode:

image
Maybe have the suggested changes be shown as a diff? maybe even have a prompt to incorporate the changes, similarly to a merge conflict.

Activity

  1. glemaitre commented on Jan 28, 2019

    @glemaitre

    This would be really useful to have it when making reviews through the VS code.

  2. mledom commented on Jan 30, 2019

    @mledom

    With 589 and this functionality you would be pretty much be able to do the whole PR from VS code!

  3. melink14 commented on Sep 14, 2019

    @melink14

    Does this FR only cover displaying the suggestions made elsewhere or also being able to make suggestions from VS code? Both would be great!

  4. jonathanvila commented on Apr 17, 2020

    @jonathanvila

    I found this feature very interesting.... is it gonna be put in the roadmap ?

  5. arubtsov commented on Apr 21, 2020

    @arubtsov

    It would be very handy if I could just open a file, make some changes in it and post them as a suggestion.

  6. Draal commented on Aug 27, 2020

    @Draal

    It would be really big improvements for dev productivity

  7. ankitbko commented on Apr 12, 2021

    @ankitbko
    Member

    Any update on this? Currently the suggestion overflow the width of the comment box without anyway to scroll
    image

  8. sahmadi-wave commented on Apr 16, 2021

    @sahmadi-wave

    Yes, this feature would be very useful. Currently we can add suggestions (using ```suggestion) but they don't show up properly. For example, the suggestion to remove a line does is not displayed at all.

  9. georgfaust commented on Jun 17, 2021

    @georgfaust

    this would also require #1376

    without these two features this plugin is just useless.

  10. glemaitre commented on Jun 22, 2021

    @glemaitre

    without these two features this plugin is just useless.

    Your comment is extremely toxic. It does not bring any value to the discussion.

  11. georgfaust commented on Jul 3, 2021

    @georgfaust

    without these two features this plugin is just useless.

    Your comment is extremely toxic. It does not bring any value to the discussion.

    you're right sorry. Just being frustrated finding no tools to make reviews outside of the Github webgui. Even jetbrains can't do it.

  12. EthanJStark commented on Sep 2, 2021

    @EthanJStark

    ++ for this suggestion!

    I'd also note that it could be extremely useful if a user shifts into "PR Review Suggestion Mode" so that any code changes made in VS Code's editors were batched as PR Comment code change suggestions.

    (but even a basic implementation would be extremely helpful)

  13. Lovkush-A commented on Sep 5, 2021

    @Lovkush-A

    So just to check my understanding, currently the best way to make code suggestions (especially code suggestions for multiple lines of code) is to use GitHub's online GUI. Is that right?

  14. 0x24a537r9 commented on Oct 2, 2021

    @0x24a537r9

    For single line changes (since #1376 is still open), you can manually type:

    ```suggestion
      your suggestion
    \```
    

    (ignore that slash though—I just don't know how to escape backticks in markdown)

  15. 31 remaining items

  16. added 2 commits that reference this issue on Dec 31, 2022
    38a7b01
    3af7745
  17. JustinGrote commented on Apr 6, 2023

    @JustinGrote

    Alex Ross (@alexr00) this is great! One feature I would like to request is a settings option to create a commit on every applied suggestion. Right now, you can apply a suggestion and resolve a conversation, but then if something happens in between, that change gets lost. Should I file this as a separate issue?

  18. alexr00 commented on Apr 11, 2023

    @alexr00
    Member

    Justin Grote (@JustinGrote) a separate issue for that makes sense. Personally, I don't want to have a separate commit per suggestion as that feels like an implementation detail from when you could only accept suggestions on github.com. I'd like to gauge interested in having separate commits like this though, as others like yourself may prefer to have many smaller commits.

  19. JustinGrote commented on Apr 11, 2023

    @JustinGrote

    FYI the "apply suggestion" button in the github web UI does exactly this, so it's not without precedent, and those who are coming from the web UI experience are going to expect this flow like I did. I agree it probably shouldn't be the default as that's not typical of vs code flow but there should at least be a setting to enable it.

  20. Dru01 commented on May 19, 2023

    @Dru01

    Alex Ross (@alexr00) Is there anyway to commit suggestions? Like in comment suggestions made in github? Something like I agree with it so I apply it. I found a "Apply patch" button when a suggestion is made inside vscode, but anything when it was send by github.

  21. alexr00 commented on May 22, 2023

    @alexr00
    Member

    Rubén Pérez Palacios (@Dru01) that is what is requested in #603 (comment). Currently, the suggestion will be applied locally, but not committed.

  22. lgruen commented on May 23, 2023

    @lgruen

    Alex Ross (@alexr00) Thanks for your work on this! I can't seem to find a button in the review comment to invoke the pr.applySuggestion command, even in an up-to-date Insiders build:

    CleanShot 2023-05-23 at 11 47 24@2x

  23. alexr00 commented on May 23, 2023

    @alexr00
    Member

    Leonhard Gruenschloss (@lgruen) do you have the PR checked out? We only support accepting a suggestion in a checked out PR.

  24. lgruen commented on May 23, 2023

    @lgruen

    Alex Ross (@alexr00) Yes, this was on a checked out PR. I used the checkout button on the PR description and also double-checked that the right branch was shown in the status bar. Not sure whether that makes a difference, but I hadn't created this PR through VS Code, but directly in GitHub's web interface.

  25. alexr00 commented on May 23, 2023

    @alexr00
    Member

    Leonhard Gruenschloss (@lgruen) it shouldn't make a difference. Is this a public PR that you could share a link to? There's likely something about this specific comment that we're not parsing correctly.

  26. lgruen commented on May 23, 2023

    @lgruen

    Alex Ross (@alexr00) In the meantime I've accepted the suggestions using the GitHub web interface, but the original PR suggestion from the screenshot is this one: populationgenomics/cpg-infrastructure#132 (comment)

    I can also try to create another new PR if it's not reproducible with the above one anymore.

  27. alexr00 commented on May 23, 2023

    @alexr00
    Member

    Leonhard Gruenschloss (@lgruen) thanks! I found a way to reproduce the issue that might be what you're hitting: #4839

  28. lgruen commented on May 23, 2023

    @lgruen

    Alex Ross (@alexr00) Great, that totally sounds like it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions