extract_superclass
MCP tools › Code insight and refactoring
Extract Superclass for the class at (or around) a position of a JavaScript or TypeScript file: creates class name before it with the chosen members, moves them there and makes the class extend it. dry_run defaults to true and returns the edits per file; dry_run=false writes them. Refuses with the reasons when it cannot.
Its results carry text from files, language_server: the client is told to treat that as data, never as instructions.
| Capability | code.extract_superclass |
|---|---|
| Area | Code insight and refactoring |
| Access | changes files |
| Reaches | — |
| Rights | write |
| Dry run | dry_run, on unless the call turns it off |
Arguments
| Argument | Type | Description |
|---|---|---|
pathrequired | string | Workspace-relative file path. |
linerequired | integer | 0-based line.minimum 0 |
characterrequired | integer | 0-based character in the line (Unicode scalar values).minimum 0 |
namerequired | string | The name of the new type. |
membersrequired | array of string | Names of the chosen members (see class_members). |
dry_run | boolean | Only report the edits (default true). |
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 extract_superclass '{"path":"<string>","line":1,"character":1,"name":"<string>","members":[]}'Input schema as JSON
{ "type": "object", "required": [ "path", "line", "character", "name", "members" ], "properties": { "path": { "description": "Workspace-relative file path.", "type": "string" }, "line": { "description": "0-based line.", "type": "integer", "minimum": 0 }, "character": { "description": "0-based character in the line (Unicode scalar values).", "type": "integer", "minimum": 0 }, "name": { "description": "The name of the new type.", "type": "string" }, "members": { "description": "Names of the chosen members (see `class_members`).", "type": "array", "items": { "type": "string" } }, "dry_run": { "description": "Only report the edits (default true).", "type": [ "boolean", "null" ] } }}