9

I found this somewhat recent mention of experimental PR features, and they mentioned the ability to insert and apply suggestions from the PR itself.

That's a feature I've grown very accustomed to with other products, but I'm a bit lost as to how I can access this feature in Azure DevOps in the present day.

enter image description here

Here is what I actually see: No lightbulb icon, etc.

riQQ
  • 9,878
  • 7
  • 49
  • 66
user15716642
  • 171
  • 1
  • 12

2 Answers2

10

This feature should be enabled by default.

Open any pull request, navigate to the Files tab, choose the file and click a tooltip to enter a comment:

enter image description here

Now in the form that opens you'll see the button to add a suggestion:

enter image description here

Yan Sklyarenko
  • 31,557
  • 24
  • 104
  • 139
  • What does it mean if I don't have this option? – user15716642 Aug 11 '21 at 18:17
  • @user15716642 Do you have Azure DevOps Server (hosted on-prem) or are you using Azure DevOps Services (cloud version)? If it's on-prem, then it might be of an older version than the one this feature arrived with. Otherwise, if it's the cloud version, the feature should be there. I failed to find a special flag to turn it on/off. – Yan Sklyarenko Aug 12 '21 at 06:54
5

The "Insert a suggestion" option is not for the comments to the changed files.

Basically it is used to suggest changes for the following things in a file:

  • A line of content in the file.
  • Multiple selected lines of content in the file.
  • Any selected content in the file.

enter image description here

Bright Ran-MSFT
  • 5,190
  • 1
  • 5
  • 12
  • My issue was that I was clicking on lines in files that were removed and for comments on a file itself (derp). I realized my mistake yesterday, but if you can add a note about removed files then this will be a pretty good answer. I believe this is supported in other git-based source control systems but I get that it's very difficult to properly implement as it'd have to restore the file as well. – user15716642 Aug 13 '21 at 16:09
  • 1
    Just to note here - The above GIF does show it but it's not super obvious and gets me every time. When selecting multiple lines, DevOps shows the comment button near the margin, but there is another identical-looking button on the margin itself. You want the rightmost button to leave suggestions otherwise the suggestion only applies to one line – Will Westrop Mar 02 '23 at 11:06
  • 1
    Another note: I can only add a multi line comment, if I select a single file on the file tree on the left and not in the overview of all files changed. Tested on Azure DevOps Server 2020 Update 1. – riQQ Mar 20 '23 at 08:50