previewEdit
Previews file edits as a unified diff without writing changes to disk, enabling safe review of line range or search-and-replace operations.
Instructions
Preview what editText or searchAndReplace would do as a unified diff, without writing to disk.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | Workspace-relative or absolute path to the file | |
| operation | Yes | Type of edit to preview | |
| startLine | No | Start line (1-based, lineRange only) | |
| endLine | No | End line inclusive (1-based, lineRange only) | |
| newContent | No | Replacement content for the line range | |
| search | No | Pattern to search for (searchReplace only) | |
| replace | No | Replacement text (searchReplace only) | |
| useRegex | No | Treat search as a regex (searchReplace only, default false) | |
| caseSensitive | No | Case-sensitive search (searchReplace only, default true) |