rename_file
Rename or move a file to a new location, creating parent directories as needed. Optionally overwrite existing files and update IDE symbol indexes immediately.
Instructions
Move (rename) a file. Parent directories of to are created if missing. Refuses to overwrite an existing destination unless overwrite=true. The LSP server is notified with FileDeleted (source) and FileCreated (destination) so symbol indexes and diagnostics update immediately. To duplicate a file without removing the source, use copy_file instead. For LSP-semantic identifier renames across files, use rename_symbol instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Absolute path, file:// URI, or workspace-relative path of the destination file. Parent directories are created automatically. | |
| from | No | Absolute path, file:// URI, or workspace-relative path of the source file. | |
| dirty_ok | No | Allow moving a file that has uncommitted changes in its git repository. Default false — the move is refused if the source file is dirty. Pass true to proceed anyway. | |
| overwrite | No | Allow overwriting an existing destination file. Default false. |