lsp-edit-symbol

Solid

Edit a named symbol without knowing its file or position. Use when you want to change a function, type, or variable by name and don't have exact coordinates. Resolves the symbol to its definition, retrieves its full range, and applies the edit.

AI & Automation 56 stars 2 forks Updated today MIT

Install

View on GitHub

Quality Score: 91/100

Stars 20%
58
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# lsp-edit-symbol Edit a named symbol (function, type, variable) without needing its exact file path or line/column. Primary path uses `replace_symbol_body` for direct symbol replacement. Falls back to `find_symbol` + `list_symbols` + `apply_edit` when the server does not support document symbols well. ## Workflow ### Step 1 — Locate the file ```json { "tool": "find_symbol", "query": "MyFunc" } ``` Returns a list of matching symbols with file URI and position. Pick the definition (not a test file, not a stub). If multiple matches, use the container name or file path to disambiguate. ### Step 2 — Replace the symbol body (primary path) Use `replace_symbol_body` to replace the entire function/method/type body by name: ```json { "tool": "replace_symbol_body", "file_path": "/path/to/file.go", "symbol_path": "MyFunc", "new_body": "func MyFunc() error {\n\treturn nil\n}" } ``` For methods, use dot notation: `"MyStruct.Method"`. This resolves the symbol by name within the file, finds its full range, and replaces it atomically. No position math required. **If `replace_symbol_body` fails** (e.g., the server cannot resolve document symbols for this file), fall back to the manual path below. ### Fallback — Manual resolution via document symbols **Step 2b — Get the full range:** ```json { "tool": "list_symbols", "file_path": "/path/to/file.go", "language_id": "go" } ``` Find `MyFunc` in the returned tree. The `range` field covers the entire symbol including it...

Details

Author
blackwell-systems
Repository
blackwell-systems/agent-lsp
Created
2 months ago
Last Updated
today
Language
Go
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category