Extract Constant
extractConstantExtract a selected expression into a named constant with TypeScript type inference. Preview changes before applying, and rename the constant afterwards.
Instructions
Extract the selected expression into a named constant. TypeScript infers the type. The response includes renameFilename/renameLocation so you can follow up with rename_symbol to give the constant a meaningful name.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | File path (absolute or relative to cwd) | |
| endLine | Yes | 1-based end line | |
| preview | Yes | If true, only preview changes | |
| endOffset | Yes | 1-based end character offset | |
| startLine | Yes | 1-based start line | |
| startOffset | Yes | 1-based start character offset |