# AZD: Comment and suggest changes

> For the complete documentation index, see [llms.txt](https://edgafner.github.io/llms.txt).

> **TL;DR**
> Add a comment: hover over a line in the pull request diff and click + in the gutter
>
>
>
> Next and previous comment: `Ctrl+Alt+Down` and `Ctrl+Alt+Up` (the Next Occurrence and Previous Occurrence shortcuts)
>
>
>
> Publish drafts: Submit Comments on the diff toolbar

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](pull-request-details.html#diff-viewer).

## Comment on code

Procedure: Add a comment to a line or a block

1. In the diff of the pull request, hover over a line, or select several lines, and click + in the gutter.

2. 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).

3. 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.

> **Warning:**
> AZD saves drafts on this computer only. It deletes drafts in these cases:
>
>
>
> * New commits are pushed to the pull request.
>
> * The source branch of the pull request is deleted.
>
> * The draft is more than 30 days old.
>
> * The pull request list refreshes and does not show the pull request, for example because it is completed or a filter hides it.
>
>
>
> Submit your drafts when you finish a review.

Procedure: Write and submit draft comments

1. When you add a comment, click the arrow on Add Comment and select Add Draft. The comment shows a PENDING tag.

2. Repeat for the other files. To publish one draft right away, click Post now on it.

3. On the diff toolbar, click Submit Comments. The button shows the number of drafts, for example Submit Comments (3).

4. 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

Procedure: Suggest a change

1. In the diff, select the lines to change and start a comment.

2. Click Insert Suggestion with Selected Lines and edit the inserted code.

3. Post the comment.

Procedure: Apply a suggested change

Check out the source branch of the pull request first; see [Check out the pull request branch](pull-request-details.html#check-out-branch).

1. Find the comment with the Suggested change block.

2. 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](azd-ai.html).

To let AI write a review comment for the selected lines, see [Generate a comment for selected lines](ai-pull-request-review.html#ai_generated_comments).

## Navigate between comments

In the diff, click Previous Comment or Next Comment on the toolbar. For their shortcuts, see [Read the diff](pull-request-details.html#diff-viewer).

## See also

### Related topics

[AZD: Review a pull request](pull-request-details.html) [AZD: Vote, complete and merge](azd-pr-complete.html) [AZD: Review pull requests with AI](ai-pull-request-review.html)

### Useful resources

[Review pull requests (Microsoft Learn)](https://learn.microsoft.com/en-us/azure/devops/repos/git/review-pull-requests)

