extract_function
Refactor code by extracting selected lines into a new named function to improve modularity and reusability.
Instructions
Extract selected code into a new function
Input Schema
Name | Required | Description | Default |
---|---|---|---|
endCharacter | No | End character position | |
endLine | Yes | End line of code to extract | |
file | Yes | File containing the code to extract | |
functionName | Yes | Name for the new function | |
language | No | Programming language | typescript |
startCharacter | No | Start character position | |
startLine | Yes | Start line of code to extract |
Input Schema (JSON Schema)
{
"properties": {
"endCharacter": {
"default": 0,
"description": "End character position",
"type": "number"
},
"endLine": {
"description": "End line of code to extract",
"type": "number"
},
"file": {
"description": "File containing the code to extract",
"type": "string"
},
"functionName": {
"description": "Name for the new function",
"type": "string"
},
"language": {
"default": "typescript",
"description": "Programming language",
"type": "string"
},
"startCharacter": {
"default": 0,
"description": "Start character position",
"type": "number"
},
"startLine": {
"description": "Start line of code to extract",
"type": "number"
}
},
"required": [
"file",
"startLine",
"endLine",
"functionName"
],
"type": "object"
}