SKILL·2ADBCB

lsp-edit-symbol

blackwell-systems
Updated 1 month ago
71
3
71
View on GitHub
Othergeneral

About

This Claude Skill enables editing code symbols (functions, types, variables) by name alone, without needing their file paths or exact positions. It automatically resolves the symbol's definition, retrieves its full range, and applies your edit. Use it when you want to change a symbol's body or signature but only know its name.

Quick Install

Claude Code

Recommended
Primary
npx skills add blackwell-systems/agent-lsp -a claude-code
Plugin CommandAlternative
/plugin add https://github.com/blackwell-systems/agent-lsp
Git CloneAlternative
git clone https://github.com/blackwell-systems/agent-lsp.git ~/.claude/skills/lsp-edit-symbol

Copy and paste this command in Claude Code to install this skill

Documentation

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

{ "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:

{
  "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:

{
  "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 its body; selectionRange covers only the name.

Step 3b — Apply the edit:

Option A (text-match, recommended when you have the old text):

{
  "tool": "apply_edit",
  "file_path": "/path/to/file.go",
  "old_text": "func MyFunc() {",
  "new_text": "func MyFunc() error {"
}

Option B (positional, when you have the exact range):

{
  "tool": "apply_edit",
  "workspace_edit": {
    "changes": {
      "file:///path/to/file.go": [{
        "range": { "start": {"line": 12, "character": 0}, "end": {"line": 18, "character": 1} },
        "newText": "func MyFunc() error {\n\treturn nil\n}"
      }]
    }
  }
}

Decision guide

SituationApproach
Replacing full bodyreplace_symbol_body (primary path)
Changing signature onlyStep 1 + apply_edit with one-line old_text
Symbol name ambiguousUse find_symbol query + container name filter
Server lacks document symbolsFallback path (Step 2b + 3b)
After editRun get_diagnostics to verify no errors introduced

Notes

  • replace_symbol_body is the preferred path for full-body replacements. It handles symbol resolution and range calculation internally.
  • find_symbol returns declaration sites, not all references. The first non-test result is usually the definition.
  • Positions in list_symbols are 1-based (shifted from LSP convention). apply_edit workspace_edit expects 0-based; subtract 1 when using positional mode (Option B). Text-match mode (Option A) requires no position math.
  • For renames (not edits), use /lsp-rename instead; it updates all call sites.

GitHub Repository

blackwell-systems/agent-lsp
Path: skills/lsp-edit-symbol
0
agentskillsai-agentsai-toolingclaudeclaude-codecode-intelligence
FAQ

Frequently asked questions

What is the lsp-edit-symbol skill?

lsp-edit-symbol is a Claude Skill by blackwell-systems. Skills package instructions and resources that Claude loads on demand, so Claude can perform lsp-edit-symbol-related tasks without extra prompting.

How do I install lsp-edit-symbol?

Use the install commands on this page: add lsp-edit-symbol to Claude Code as a plugin, or clone its repository into your skills directory, then restart Claude so it picks up the skill.

What category does lsp-edit-symbol belong to?

lsp-edit-symbol is in the Other category, tagged general.

Is lsp-edit-symbol free to use?

Yes. lsp-edit-symbol is listed on AIMCP and free to install. It runs inside Claude, so no separate service account is required to use the skill itself.

Related Skills

llamaguard
Other

LlamaGuard is Meta's 7-8B parameter model for moderating LLM inputs and outputs across six safety categories like violence and hate speech. It offers 94-95% accuracy and can be deployed using vLLM, Hugging Face, or Amazon SageMaker. Use this skill to easily integrate content filtering and safety guardrails into your AI applications.

View skill
cost-optimization
Other

This Claude Skill helps developers optimize cloud costs through resource rightsizing, tagging strategies, and spending analysis. It provides a framework for reducing cloud expenses and implementing cost governance across AWS, Azure, and GCP. Use it when you need to analyze infrastructure costs, right-size resources, or meet budget constraints.

View skill
sports-betting-analyzer
Other

This Claude Skill analyzes sports betting markets including spreads, over/unders, and prop bets by examining historical trends and situational statistics to identify value bets. It provides structured markdown output with actionable recommendations for educational purposes. Developers should use this for sports betting analysis tools while noting it's designed for entertainment/education only.

View skill
quantizing-models-bitsandbytes
Other

This skill quantizes LLMs to 8-bit or 4-bit precision using bitsandbytes, achieving 50-75% memory reduction with minimal accuracy loss. It's ideal for running larger models on limited GPU memory or accelerating inference, supporting formats like INT8, NF4, and FP4. The skill integrates with HuggingFace Transformers and enables QLoRA training and 8-bit optimizers.

View skill