Move Symbol
moveSymbolMove top-level declarations like functions, classes, types, or constants to another file with automatic import rewiring across the project.
Instructions
Move top-level declarations (functions, classes, types, constants) to another file. Automatically rewires all imports across the project. If the target file does not exist, tsserver creates it.
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 | |
| targetFile | Yes | Destination file path (absolute or relative to cwd) | |
| startOffset | Yes | 1-based start character offset |