Skip to content

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.

Capabilitycode.preview_multi_caret_edit
AreaCode insight and refactoring
Accessreads only
Reaches—
Rightsnone
Dry runnone

Arguments

ArgumentTypeDescription
pathrequiredstringWorkspace-relative file path.
occurrencerequiredstringText whose occurrences get a caret each (exact, case-sensitive).
replacementrequiredstringText 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.

Terminal window
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"
}
}
}