From lsp-setup
Sets up Language Server Protocol (LSP) support in Claude Code for go-to-definition, find-references, hover, and diagnostics. Detects project languages, installs server binaries, and validates the setup.
How this skill is triggered — by the user, by Claude, or both
Slash command
/lsp-setup:lsp-setupThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Set up Language Server Protocol support in Claude Code for the current project. This enables semantic code intelligence: go-to-definition, find-references, hover, document symbols, workspace symbols, diagnostics, and call hierarchy — all at ~50ms instead of 30-60s grep-based navigation.
Set up Language Server Protocol support in Claude Code for the current project. This enables semantic code intelligence: go-to-definition, find-references, hover, document symbols, workspace symbols, diagnostics, and call hierarchy — all at ~50ms instead of 30-60s grep-based navigation.
This skill operates as a state machine. On each invocation, detect the current state and resume from the appropriate step:
To detect state quickly: attempt an LSP documentSymbol call on any source file in the project. If it returns results, skip to validation. If "No LSP server available", check whether plugins are installed and binaries are on PATH.
Determine the current environment by checking uname -s:
MINGW* or MSYS* → MINGW (Git Bash on Windows)/proc/version contains "microsoft" → WSLDarwin → macOSThis affects install commands and PATH gotchas. Consult references/gotchas.md for environment-specific issues.
Scan the current project directory for language indicators using Glob. Check for source files (**/*.py, **/*.ts, **/*.cs, etc.) and project markers (**/pyproject.toml, **/tsconfig.json, **/Cargo.toml, etc.).
The complete detection pattern table is in references/lsp-registry.md under "Auto-Detection File Patterns" — use that as the authoritative source.
Present detected languages for confirmation. If a detected language has no official Claude Code LSP plugin, inform the user and ask whether to skip it.
Only the 12 languages in references/lsp-registry.md have official plugins. If auto-detection finds no supported languages, present the full list and let the user pick.
The verify script accepts lowercase identifiers, not registry display names. Map detected languages before invoking:
| Registry Name | Script Identifier |
|---|---|
| C# | csharp |
| C/C++ | cpp |
| TypeScript/JS | typescript |
All other languages use their lowercase name (e.g., python, go, rust, java, kotlin, lua, php, ruby, swift).
Run the verify script to check all binaries at once:
bash ${CLAUDE_PLUGIN_ROOT}/scripts/verify-lsp.sh <lang1> <lang2> ...
For any missing binary, look up the install command in references/lsp-registry.md and run it. Consult references/gotchas.md for environment-specific issues before running install commands.
Check ~/.claude/settings.json for the ENABLE_LSP_TOOL env var. If missing, add it:
{
"env": {
"ENABLE_LSP_TOOL": "1"
}
}
The settings.json env block is the primary mechanism. As a supplementary fallback, also add export ENABLE_LSP_TOOL=1 to ~/.bashrc or ~/.zshrc if not already present.
Verify the official marketplace is configured:
claude plugin marketplace list
If claude-plugins-official is not listed, add it. Run claude plugin marketplace add --help to see the required arguments, then add the marketplace. Once configured, update to fetch the latest catalog:
claude plugin marketplace update claude-plugins-official
For each language, install the corresponding plugin:
claude plugin install <plugin-name>@claude-plugins-official
Refer to references/lsp-registry.md for the language-to-plugin mapping.
Verify each plugin is enabled in the project's .claude/settings.json:
{
"enabledPlugins": {
"<plugin-name>@claude-plugins-official": true
}
}
Run claude plugin list and confirm each LSP plugin shows as enabled. If any show as disabled, run claude plugin enable <name>.
Critical: LSP servers require a full Claude Code restart to activate. /reload-plugins is NOT sufficient — it explicitly says "Restart to activate N LSP servers provided by plugins."
Display this message to the user:
LSP plugins are installed and configured. A full Claude Code restart is required to activate the LSP servers.
Please run
/exit, then relaunch Claude Code. After restart, re-invoke this skill (say "validate LSP" or "check LSP setup") to confirm everything works.
If the user provides a session ID, suggest: claude --resume <session-id>.
After restart, validate each language:
LSP documentSymbol on that fileAlso check debug logs:
grep "LSP servers loaded" ~/.claude/debug/latest
Report results per language:
| Language | Binary | Plugin | Status |
|------------|-----------|---------------|---------|
| Python | pyright | pyright-lsp | Working |
| TypeScript | ts-ls | typescript-lsp| Working |
| C# | csharp-ls | csharp-lsp | Failed |
For any failures, consult references/gotchas.md and attempt remediation.
references/lsp-registry.md — Complete plugin-to-binary mapping, install commands, auto-detection patternsreferences/gotchas.md — Environment-specific issues, troubleshooting, binary verification commandsscripts/verify-lsp.sh — Automated binary and environment verification for detected languagesOnce configured, the LSP tool provides these operations on project files:
goToDefinition — Jump to symbol source (~50ms)findReferences — All usages across the codebasehover — Type signatures and documentationdocumentSymbol — All symbols in a fileworkspaceSymbol — Search symbols across the projectgoToImplementation — Concrete implementations of interfacesincomingCalls / outgoingCalls — Call hierarchy tracingdiagnostics — Real-time type checking and error detectionnpx claudepluginhub dmitriyyukhanov/claude-plugins --plugin lsp-setupInstalls and configures LSP servers for Claude Code to enable go-to-definition, find-references, rename-symbol, and real-time diagnostics in Python, TypeScript/JS, Go, Rust, Java, C#, PHP, Kotlin, Ruby, and more.
Installs and configures LSP servers for Copilot CLI to enable go-to-definition, find-references, hover, and type info for any programming language.
Detects LSP servers for 18 languages including TypeScript, Python, Go, Rust, Java; installs missing ones via npm, pip, go; integrates with Claude Code for real-time diagnostics during /cc-setup phase 7 or project setup.