MCP HubMCP Hub
Retour aux compétences

lsp-local-symbols

blackwell-systems
Mis à jour 6 days ago
53
2
53
Voir sur GitHub
Autregeneral

À propos

Cette compétence fournit une analyse rapide des symboles à l'échelle du fichier en utilisant LSP, permettant aux développeurs de trouver les utilisations de symboles dans un fichier, de lister les symboles définis et d'obtenir des informations de type à des positions spécifiques. Elle est idéale pour l'analyse à portée locale sans recherches à l'échelle de l'espace de travail lors de l'utilisation du serveur MCP agent-lsp. Les capacités clés incluent la recherche de symboles dans le document, la mise en évidence et les informations au survol pour une exploration de code ciblée.

Installation rapide

Claude Code

Recommandé
Principal
npx skills add blackwell-systems/agent-lsp -a claude-code
Commande PluginAlternatif
/plugin add https://github.com/blackwell-systems/agent-lsp
Git CloneAlternatif
git clone https://github.com/blackwell-systems/agent-lsp.git ~/.claude/skills/lsp-local-symbols

Copiez et collez cette commande dans Claude Code pour installer cette compétence

Documentation

Requires the agent-lsp MCP server.

lsp-local-symbols

File-scoped symbol analysis using the language server index. Faster than workspace-wide search for questions about a single file: what symbols are defined here, where is this symbol used within the file, and what type does it have.

Read-only — does not modify any files.

When to use

  • "Where is x used in this file?" — use get_document_highlights
  • "What functions and types are defined in this file?" — use list_symbols
  • "What type does this symbol have?" — use inspect_symbol
  • Reviewing a file before editing — get the full symbol map first
  • Local refactor scoping — confirm a symbol is only used in one place before inlining it

Use /lsp-impact instead when you need workspace-wide callers and cross-file references. Use /lsp-dead-code when auditing exported symbols for zero callers.

When NOT to use

get_document_highlights is file-scoped by design — it only finds usages within the open file. If a symbol is used across multiple files, this skill will not find those. Use find_references (via /lsp-impact) for cross-file analysis.


Workflow

Step 1 — Open the file

Open the file so the language server tracks it:

mcp__lsp__open_document
  file_path: "/abs/path/to/file.go"
  language_id: "go"              # go, typescript, python, rust, etc.

Step 2 — List all symbols in the file

Get the full symbol tree for the file:

mcp__lsp__list_symbols
  file_path: "/abs/path/to/file.go"

This returns all functions, types, variables, constants, and methods defined in the file — including nested symbols (methods on types, fields in structs).

Use this to:

  • Understand the file's structure before editing
  • Find the exact position of a named symbol
  • See what a file exposes before reading it in full

Reading the output: Each symbol has a range (full body including braces) and a selectionRange (just the name). Coordinates are 1-based. Use selectionRange.start.line and selectionRange.start.character as inputs to get_document_highlights and inspect_symbol.

Step 3 — Find all usages within the file

Call get_document_highlights at the symbol's position:

mcp__lsp__get_document_highlights
  file_path: "/abs/path/to/file.go"
  line: <selectionRange.start.line from Step 2>
  column: <selectionRange.start.character from Step 2>

Returns every occurrence of the symbol within the file, classified as:

  • read — the symbol is read here
  • write — the symbol is assigned/mutated here
  • text — a text match (fallback when semantic classification isn't available)

Speed note: get_document_highlights is significantly faster than find_references for file-local queries — it does not scan the entire workspace index. Use it first; escalate to find_references only if you need cross-file results.

Step 4 — Get type information (optional)

For any position of interest, get the type signature and docs:

mcp__lsp__inspect_symbol
  file_path: "/abs/path/to/file.go"
  line: <line>
  column: <column>

Returns the hover text: type signature, documentation, and inferred types. Useful for confirming what a symbol is before deciding to rename or inline it.


Output format

Report results in three sections (omit any section with no content):

## Symbols in <filename>

### Functions / Methods
- `FuncName` — line N–M
- `(Type) MethodName` — line N–M

### Types
- `TypeName` (struct/interface/alias) — line N

### Variables / Constants
- `ConstName` = value — line N

---

## Usages of `<symbol>` in <filename>

N occurrences across M lines:
- line 12 [write] — assignment
- line 34 [read]  — passed as argument
- line 67 [read]  — returned

---

## Type info

`<symbol>`: <type signature from inspect_symbol>

Decision guide

QuestionTool
What's in this file?list_symbols
Where is X used in this file?get_document_highlights
What type is X?inspect_symbol
Is X safe to inline (used once)?get_document_highlights — count occurrences
Is X used outside this file?Use /lsp-impact instead
Is X dead code (no callers anywhere)?Use /lsp-dead-code instead

Example

# "Where is the `config` variable used in server.go?"

open_document(file_path="/repo/server.go", language_id="go")
list_symbols(file_path="/repo/server.go")
  → finds `config` at selectionRange line 42, col 2

get_document_highlights(file_path="/repo/server.go", line=42, column=2)
  → returns 7 occurrences: 1 write (line 42), 6 reads

inspect_symbol(file_path="/repo/server.go", line=42, column=2)
  → "config *Config — the parsed server configuration"

Dépôt GitHub

blackwell-systems/agent-lsp
Chemin: skills/lsp-local-symbols
0
agentskillsai-agentsai-toolingclaudeclaude-codecode-intelligence

Compétences associées

llamaguard

Autre

LlamaGuard est le modèle de Meta, doté de 7 à 8 milliards de paramètres, conçu pour modérer les entrées et sorties des LLM selon six catégories de sécurité comme la violence et les discours haineux. Il offre une précision de 94 à 95 % et peut être déployé avec vLLM, Hugging Face ou Amazon SageMaker. Utilisez cette compétence pour intégrer facilement le filtrage de contenu et des garde-fous de sécurité dans vos applications d'IA.

Voir la compétence

cost-optimization

Autre

Cette compétence de Claude aide les développeurs à optimiser les coûts du cloud grâce au redimensionnement des ressources, aux stratégies d'étiquetage et à l'analyse des dépenses. Elle fournit un cadre pour réduire les dépenses cloud et mettre en œuvre une gouvernance des coûts sur AWS, Azure et GCP. Utilisez-la lorsque vous devez analyser les coûts d'infrastructure, redimensionner les ressources ou respecter des contraintes budgétaires.

Voir la compétence

quantizing-models-bitsandbytes

Autre

Cette compétence quantifie les LLMs en précision 8 bits ou 4 bits à l'aide de bitsandbytes, permettant une réduction de 50 à 75 % de la mémoire utilisée avec une perte de précision minime. Elle est idéale pour exécuter des modèles plus volumineux sur une mémoire GPU limitée ou pour accélérer l'inférence, prenant en charge des formats comme INT8, NF4 et FP4. La compétence s'intègre à HuggingFace Transformers et permet l'entraînement QLoRA ainsi que l'utilisation d'optimiseurs en 8 bits.

Voir la compétence

dispatching-parallel-agents

Autre

Cette compétence Claude déploie plusieurs agents pour enquêter et résoudre simultanément 3 problèmes indépendants ou plus. Elle est conçue pour des scénarios impliquant des défaillances non liées qui peuvent être résolues sans état partagé ni dépendances. La capacité fondamentale est la résolution de problèmes en parallèle, en assignant un agent par domaine problématique indépendant afin de maximiser l'efficacité.

Voir la compétence