EditOperation
A single edit operation to perform on a file. Supports multiple edit types: find/replace, line-range replacement, insert, and delete.
Kind: an object, used in requests.
Fields
Section titled “Fields”| Field | Type | Required | Description |
|---|---|---|---|
type | string | Operation type: “replace” (find/replace), “replaceLines”, “insertAfter”, “deleteLines”. | |
find | string | null | String to find (for a replace operation). | |
replace | string | null | String to replace with (for a replace operation). | |
replaceAll | boolean | Replace all occurrences, not just first (for a replace operation). Default false. | |
startLine | integer | null | Start line number, 1-based (for a replaceLines operation). | |
endLine | integer | null | End line number, 1-based, inclusive (for a replaceLines operation). | |
content | string | null | New content to replace lines with (for a replaceLines or insertAfter operation). | |
insertAfterLine | integer | null | Insert new content after this line number, 1-based (for an insertAfter operation). Use 0 to insert at the beginning of the file. | |
deleteLines | integer[] | null | Line numbers to delete, 1-based (for a deleteLines operation). |
Example
Section titled “Example”{ "type": "...", "find": "...", "replace": "...", "replaceAll": false, "startLine": 0, "endLine": 0, "content": "...", "insertAfterLine": 0, "deleteLines": [ 0 ]}Where it’s used
Section titled “Where it’s used”- Inside
BatchEditFileRequest - Inside
EditRequest