preview_multi_caret_edit
MCP tools › Code insight and refactoring
Preview a multi-caret edit: put a caret on every occurrence of a text in a workspace file (as 'select all occurrences' does) and type the replacement at all of them. Returns the number of carets, their character offsets before the edit and the resulting text; the file is not written.
Its results carry text from files, language_server: the client is told to treat that as data, never as instructions.
| Capability | code.preview_multi_caret_edit |
|---|---|
| Area | Code insight and refactoring |
| Access | reads only |
| Reaches | — |
| Rights | none |
| Dry run | none |
Arguments
| Argument | Type | Description |
|---|---|---|
pathrequired | string | Workspace-relative file path. |
occurrencerequired | string | Text whose occurrences get a caret each (exact, case-sensitive). |
replacementrequired | string | Text typed at every caret, replacing the occurrences. |
Call it from a shell
ferris-idea call runs one tool with the rights and safe mode of ferris-idea mcp. Replace the folder and the placeholder values.
ferris-idea call ~/my-project preview_multi_caret_edit '{"path":"<string>","occurrence":"<string>","replacement":"<string>"}'Input schema as JSON
{ "type": "object", "required": [ "path", "occurrence", "replacement" ], "properties": { "path": { "description": "Workspace-relative file path.", "type": "string" }, "occurrence": { "description": "Text whose occurrences get a caret each (exact, case-sensitive).", "type": "string" }, "replacement": { "description": "Text typed at every caret, replacing the occurrences.", "type": "string" } }}