extract_method
Extract selected Java code into a new method by analyzing variables to generate parameters and return type, then provide text edits for method declaration and call site.
Instructions
Extract a code block into a new method.
USAGE: Select code range, provide method name OUTPUT: Text edits for method declaration and call site
The tool analyzes the selected code to:
Determine which variables become parameters
Determine return type based on variables modified
Generate appropriate method signature
IMPORTANT: Uses ZERO-BASED coordinates.
Requires load_project to be called first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endColumn | Yes | Zero-based end column | |
| filePath | Yes | Path to source file | |
| startColumn | Yes | Zero-based start column | |
| endLine | Yes | Zero-based end line of code to extract | |
| startLine | Yes | Zero-based start line of code to extract | |
| methodName | Yes | Name for the new method |