Claude Code LSPs
This repository contains a Claude Code marketplace with plugins that offer LSP servers for TypeScript, Rust, Python, Go, Java, Kotlin, C/C++, PHP, Ruby, C#, PowerShell, HTML/CSS, LaTeX, and BSL (1C:Enterprise). LSP servers provide powerful and familiar code intelligence features to IDEs, and now Claude Code directly.
Claude Code officially supports LSP. In 2.0.74 they officially added it to the changelog. Previously, the new LSP builtin tool had to be enabled manaually via $ENABLE_LSP_TOOL=1.
Claude can the LSP tool to
- Go to the definition for symbols (
goToDefinition)
- Go to the implementation for symbols (
goToImplementation)
- Hover over symbols (
hover)
- List all the symbols in a file (
documentSymbol)
- Find all references to a symbol (
findReferences)
- Search for symbols across the workspace (
workspaceSymbol)
- Get the call hierarchy for a given function (
prepareCallHierarchy)
- Find all functions that call a given function (
incomingCalls)
- Find all functions/methods called by a given function (
outgoingCalls)
[!warning]
Support for LSP in Claude Code is pretty raw still. There are bugs in the different LSP operations, no documention, and no UI indication that your LSP servers are started/running/have errors or even exist. But it's there, and with tweakcc you can make it work.
Patching Claude Code
Run npx tweakcc --apply. tweakcc automatically detects your Claude Code installation (npm or native) and applies the necessary patches. It will automatically patch your Claude Code installation to make CC's builtin LSP support usable. (It also does a bunch of other things like let you customize all the system prompt parts, create new CC themes, change the thinking verbs, and a lot more.)
Installing the plugins
Install them the usual way. First make CC aware of the marketplace:
- Run
claude
/plugin marketplace add Piebald-AI/claude-code-lsps
Then enable the plugins of your choice:
- Run
claude
- Type
/plugins
- Tab to
Marketplaces
- Enter the
claude-code-lsps marketplace and choose Browse plugins
- Select the plugins you'd like with the spacebar (e.g. TypeScript, Rust)
- Press "i" to install them
- Restart Claude Code
Language-specific setup instructions
You need to install various components in order for the plugins to use them:
Rust (rust-analyzer)
Uses rust-analyzer, the official modern Rust Language Server and the same one used by the official VS Code extension. If you have rustup, installing rust-analyzer is easy:
rustup component add rust-analyzer
The rust-analyzer executable needs to be in your PATH.
JavaScript/TypeScript (vtsls)
Install vtsls and typescript packages globally:
# npm
npm install -g @vtsls/language-server typescript
# pnpm
pnpm install -g @vtsls/language-server typescript
# bun
bun install -g @vtsls/language-server typescript
Make sure the vtsls executable is in your PATH.
Python (pyright)
Install pyright for its speed and excellent type checking:
# npm
npm install -g pyright
# pnpm
pnpm install -g pyright
# bun
bun install -g pyright
Go (gopls)