AZD: Comment and suggest changes
AZD posts a comment to Azure DevOps when you add it, or keeps it as a draft until you submit all drafts together. Open the diff of a file first; see Read the diff.
Comment on code
Add a comment to a line or a block
In the diff of the pull request, hover over a line, or select several lines, and click + in the gutter.
Type the comment. The editor toolbar offers Polish Grammar and Spelling with AI, Attach File, Insert Suggestion with Selected Lines and the AI button (Generate AI code review for this change).
Click Add Comment to post it now. Click the arrow on the button for Add Draft or Comment & Resolve. The button keeps your last choice: after you add a draft, it reads Add Draft until you select Add Comment under the arrow. Press Ctrl+Enter (macOS: ⌘ Enter) instead of clicking the button.
Comment on the whole pull request
Open the timeline with View Timeline in the pull request details. Type in the comment box at the end of the timeline and click Add Comment.
Review with draft comments
Drafts let you go through all files first and publish the review in one step. Other people see a draft only after you publish it.
Write and submit draft comments
When you add a comment, click the arrow on Add Comment and select Add Draft. The comment shows a PENDING tag.
Repeat for the other files. To publish one draft right away, click Post now on it.
On the diff toolbar, click Submit Comments. The button shows the number of drafts, for example Submit Comments (3).
In the Submit Review popup, optionally enter a summary comment and click Submit Comments. To delete all drafts instead, click Discard drafts; this cannot be undone.
Reply to and resolve threads
Click Reply under a thread to answer it. Use Reply and Resolve/UnResolve to answer and change the thread status in one step.
Click the status link of a thread, for example Active, and select Active, Pending, Resolved, Won't Fix or Closed.
Click the like icon to like or unlike a comment.
Edit or delete your own comments with the icons next to them.
Azure DevOps "By design" status is shown as Resolved. A thread on code that has changed since the comment shows an OUTDATED tag.
Mention people, pull requests and work items
In comments and in the Submit Review popup, type a trigger character and pick an item from the completion list. In the description of a new pull request, only ! and # work:
- @
A person or group in the organization.
- !
A pull request, including completed and abandoned ones that you created or reviewed.
- #
A work item.
Attach files and images
Click Attach File in the comment editor and select a file, for example a PNG, JPG, GIF, BMP, PDF or TXT file. You can also paste an image from the clipboard with Ctrl+V (macOS: ⌘ V). Attachments can be up to 60 MB. You cannot add attachments when you edit an existing comment.
Images in comments render inline. Click an image to open it in an editor tab, where you can zoom and pan.
Suggest and apply code changes
Suggest a change
In the diff, select the lines to change and start a comment.
Click Insert Suggestion with Selected Lines and edit the inserted code.
Post the comment.
Apply a suggested change
Check out the source branch of the pull request first; see Check out the pull request branch.
Find the comment with the Suggested change block.
Click Apply Locally to change the file in your working tree. To apply and commit at once, click the arrow on the button and select Commit....
A suggestion cannot be applied when it is outdated, when its thread is resolved, or when a different branch is checked out. The button tooltip gives the reason.
Polish a comment with AI
Click Polish Grammar and Spelling with AI in the comment editor to fix the grammar and spelling of your text before you post it. It uses your active AI provider; see AZD: AI assistant.
To let AI write a review comment for the selected lines, see Generate a comment for selected lines.
Navigate between comments
In the diff, click Previous Comment or Next Comment on the toolbar. For their shortcuts, see Read the diff.