Diff Review
Review AI-proposed file changes in a native VS Code diff view before applying them — with editable right pane and one-click accept or reject.
Overview
When the Misar Code agent proposes changes to a file, it opens a native VS Code diff view so you can review every line before anything is written to disk. The left pane shows the original file (read-only) and the right pane shows the proposed version (editable). You are always in control.
If you prefer to see proposed changes overlaid directly in the editor instead of a separate diff tab, enable Inline Edit mode.
The Diff View
Left Pane — Original
The current file contents, read-only. Scroll in sync with the right pane to compare changes line by line.
Right Pane — Proposed
The AI-proposed version of the file. This pane is editable — you can modify the proposal before accepting it.
Added lines are highlighted in green, removed lines in red — standard VS Code diff colors that respect your current color theme.
Accepting and Rejecting
| Action | How |
|--------|-----|
| Accept | Click the Accept button in the diff toolbar, or run Misar Code: Accept Changes from the Command Palette |
| Reject | Click the Reject button, or press Escape while the diff tab is focused |
Accepting applies the right-pane content to the file. If misar.autosaveOnAccept is enabled, the file is saved immediately after applying.
You can edit the right pane before accepting. This lets you combine the agent's suggestion with your own adjustments in a single save.
Apply Button on Code Blocks
When the agent outputs a code block in the chat (e.g., a function rewrite), an Apply button appears in the code block header. Clicking Apply opens the diff view for that specific block rather than applying it blindly — giving you the same review workflow as a full-file change.
The agent outputs a code block with a proposed change.
Click the Apply button in the top-right corner of the code block.
A diff view opens showing the current file on the left and the proposed insertion on the right.
Review, optionally edit the right pane, then accept or reject.
Auto-Accept Mode
For high-trust workflows (e.g., automated refactors where you have version control as a safety net), you can enable auto-accept:
- Open Settings (
Cmd+,/Ctrl+,) - Search for
misar autoAcceptChanges - Enable Misar Code: Auto Accept Changes
{
"misar.autoAcceptChanges": true,
"misar.autosaveOnAccept": true
}
Auto-accept skips the diff review step entirely. Only enable this if you are working in a git repository where you can revert unwanted changes. It is off by default for this reason.
Configuration Reference
| Setting | Type | Default | Description |
|---------|------|---------|-------------|
| misar.autoAcceptChanges | boolean | false | Automatically apply proposed changes without showing a diff |
| misar.autosaveOnAccept | boolean | true | Save the file immediately after accepting a diff |