When AI suggests code changes, the Diff View displays them for you to review rather than applying them automatically. This gives you full control, allowing you to understand every modification before you apply it. This article explains how to review, manage, and apply these changes at the change block or file level.
The Diff View uses color-coding to distinguish between new, deleted, and unchanged lines of code:
You can then review the changes and apply them per change block or to the entire file.
To control individual changes, use the options in the upper-right corner of each change block:
To manage all suggested changes in the current file at once, use the controls at the bottom of the file:
When a task modifies multiple files, a list of all affected files appears above the AI Chat panel. You can use the following operations to manage these cross-file changes:
Diff preview format
The Diff View uses color-coding to distinguish between new, deleted, and unchanged lines of code:
- Added content: New lines of code are highlighted in green.
- Deleted content: Removed lines of code are highlighted in red.
- Contextual code: Unchanged lines are displayed in a neutral color to provide context and help you locate the changes within the codebase.
- See exactly what will change
- Understand why the change was made
- Evaluate how the change fits into your existing codebase
Diff view in a single file
You can then review the changes and apply them per change block or to the entire file.
Block-level operations
To control individual changes, use the options in the upper-right corner of each change block:
- Accept: Apply the changes in the current change block.
- Reject: Discard the changes in the current change block.
File-level operations
To manage all suggested changes in the current file at once, use the controls at the bottom of the file:
- Accept All: Apply all suggested changes in the current file.
- Reject All: Discard all suggested changes in the current file.
- File navigation: Switch to other files with pending changes.
Diff view in multiple files
When a task modifies multiple files, a list of all affected files appears above the AI Chat panel. You can use the following operations to manage these cross-file changes:
- Global operations: Perform bulk actions across all files.
- Accept: Apply all changes in all listed files.
- Reject: Discard all changes in all listed files.
-
File-level operations
-
Click a file name to open that file in the Diff View.
- Hovering over a file name displays the Reject or Accept options for that file.
-
Click a file name to open that file in the Diff View.