refactorExtractFunction
Extract selected lines of code into a new named function to improve code readability and reusability.
Instructions
Extract lines into a named function. Uses VS Code Extract Function when available.
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": {
"file": "<file>",
"startLine": "<startLine>",
"endLine": "<endLine>",
"functionName": "<functionName>"
},
"name": "refactorExtractFunction"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | File path (relative to workspace) | |
| endLine | Yes | End line (1-indexed) | |
| startLine | Yes | Start line (1-indexed) | |
| functionName | Yes | Name for the extracted function |