replace_symbol_body
Replace a function, class, or method body by specifying its name. Uses language server index to avoid reading the whole file. Preview by default; set apply=true to write changes in one call.
Instructions
Change a whole function/class/method by NAMING it — USE INSTEAD OF Read-the-file + Edit (the outline gives the span, so you skip the whole-file Read and exact-match line-counting). PREVIEW by default; apply=true writes in ONE call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | New full text (signature + body). | |
| line | No | 0-based line; disambiguate same-named (optional). | |
| path | No | File holding the symbol (else resolved via the index). | |
| apply | No | Write to disk (default false = preview). | |
| symbol | Yes | Declaration name to replace. | |
| backend | No | ||
| maxResults | No | ||
| projectPath | No |