Skip to content
Agentmart
Submit a tool

lsp-edit-symbol

Edit a named symbol without knowing its file or position.

Skill by blackwell-systems

IndexedMIT★ 164
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/blackwell-systems-lsp-edit-symbol

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

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.

Use cases: writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/lsp-edit-symbol

What's inside

Skill name
lsp-edit-symbol
Description
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.
License
MIT
Compatibility
Requires the agent-lsp MCP server (github.com/blackwell-systems/agent-lsp)
Metadata
required-capabilities: workspaceSymbolProvider
Instructions
104 lines in SKILL.md · view on GitHub

Agent Skills spec issues

  • allowed-tools: must be a space-separated string

Files (1)

  • SKILL.md

SKILL.md (first lines)

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

**Step 3b — Apply the edit:**

Option A (text-match, recommended when you have the old text):
```json
{
  "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):
```json
{
  "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

| Situation | Approach |
|-----------|----------|
| Replacing full body | `replace_symbol_body` (primary path) |
| Changing signature only | Step 1 + apply_edit with one-line old_text |
| Symbol name ambiguous | Use `find_symbol` query + container name filter |
| Server lacks document symbols | Fallback path (Step 2b + 3b) |
| After edit | Run `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.

From blackwell-systems/agent-lsp, MIT.

More from blackwell-systems/agent-lsp

Signals

Stars
164
Forks
20
Open issues
5
Contributors
9
Last commit (this folder)
May 10, 2026 (5 months ago)
Last release
Oct 24, 2026 (5 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from blackwell-systems

Cite this page

lsp-edit-symbol skill. Agent Mart. https://agentmart.dev/skills/blackwell-systems-lsp-edit-symbol (last updated 2026-10-24)