introduce_parameter
Convert a value inside a function into a new parameter, using the original expression as its default. Select the code range, name the parameter, and get a dry-run preview before applying.
Instructions
Turn a value used inside a function into a new parameter, with the original expression becoming the parameter's default. Select the expression — a name or attribute access such as a module constant or self. — with a Range (start_line/start_character to end_line/end_character, 0-based, character in UTF-16 units) inside the function body and give the parameter a name. Defaults to a Dry Run preview; set apply=true to write. Read the code with your LSP first; this tool only changes code.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | ||
| root | No | ||
| apply | No | ||
| end_line | Yes | ||
| start_line | Yes | ||
| end_character | Yes | ||
| parameter_name | Yes | ||
| start_character | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||