LSP rename symbol
nvim_lsp_renameRename the symbol at a position project-wide via the language server and apply the resulting edits (set apply=false to preview which files would change without modifying anything).
Instructions
Rename the symbol at a position project-wide via the language server and apply the resulting edits (set apply=false to preview which files would change without modifying anything).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"newName": "<newName>"
},
"name": "nvim_lsp_rename"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| col | No | 1-based column number. Default 1. | |
| line | No | 1-based line number. Default 1. | |
| path | No | Target buffer by file path (must already be open). Ignored if bufnr is set. | |
| apply | No | Apply the edits. Default true. | |
| bufnr | No | Target buffer number. Omit to use the path or the current buffer. | |
| newName | Yes | The new name for the symbol. |