extract_superclass
Move a class member into a new superclass and update the original class to extend it. Provide the superclass name and zero-based coordinates.
Instructions
Extract a new superclass from a class: the member at the position moves up into a newly created superclass, and the class extends it.
USAGE: Position on the member to extract; provide the new superclass name. OUTPUT: createdFiles carries the new superclass file content; editsByFile carries the source class's edits; warnings, present only when there is one, JDT's findings from its condition checking, by the place each names (file, then position; those naming one place in JDT's order, those naming none last). Nothing is written - create the file and apply the edits yourself.
IMPORTANT: Uses ZERO-BASED coordinates.
Requires load_project to be called first.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"filePath": "<filePath>",
"line": "<line>",
"column": "<column>",
"superclassName": "<superclassName>"
},
"name": "extract_superclass"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Zero-based line number of the member declaration | |
| column | Yes | Zero-based column number (on the member name) | |
| filePath | Yes | Path to source file containing the member | |
| superclassName | Yes | Name for the new superclass |