Claude Code LSPs

repository·main·Indexed 19 days ago

https://github.com/piebald-ai/claude-code-lsps

A marketplace of plugins that bring Language Server Protocol (LSP) capabilities to Claude Code 2.1.50+. It enables advanced code intelligence—including symbol navigation, reference finding, and call hierarchies—across languages such as TypeScript, Rust, Python, Go, Java, C/C++, and more. Requires patching Claude Code via tweakcc to enable LSP support.

Tokens
2K
Snippets
13
Records
15
Agent score
17%

What's inside claude-code-lsps

  1. Overview of Claude Code LSPs

    main

    This repository provides a marketplace of plugins for Claude Code that offer Language Server Protocol (LSP) servers for a wide variety of languages (including TypeScript, Rust, Python, Go, Java, C/C++, and more).

    LSP servers enable Claude Code to perform advanced code intelligence tasks such as:

    • goToDefinition: Go to the definition for symbols.
    • goToImplementation: Go to the implementation for symbols.
    • hover: Hover over symbols.
    • documentSymbol: List all symbols in a file.
    • findReferences: Find all references to a symbol.
    • workspaceSymbol: Search for symbols across the workspace.
    • prepareCallHierarchy: Get the call hierarchy for a given function.
    • incomingCalls: Find all functions that call a given function.
    • outgoingCalls: Find all functions/methods called by a given function.

    Compatibility Note: This marketplace targets Claude Code 2.1.50+ (latest release: 2.1.52) to utilize modern LSP configuration fields like startupTimeout.

  2. Install Java LSP (jdtls)

    main

    Install the Eclipse JDT Language Server (jdtls). This requires a Java 21+ runtime. Set the JAVA_HOME environment variable to point to your Java 21+ installation.

    # macOS via Homebrew
    brew install jdtls
    
    # Manual download
    curl -LO http://download.eclipse.org/jdtls/snapshots/jdt-language-server-latest.tar.gz
    mkdir -p ~/jdtls
    tar -xzf jdt-language-server-latest.tar.gz -C ~/jdtls
  3. Install PHP LSPs (phpactor or php-lsp)

    main

    You can use phpactor (recommended via Composer) or php-lsp (requires Rust).

    For phpactor, ensure ~/.composer/vendor/bin is in your PATH.

    # phpactor
    composer global require --dev phpactor/phpactor
    
    # php-lsp
    cargo install php-lsp
  4. Install HTML/CSS/ESLint LSPs (vscode-langservers)

    main

    Install @zed-industries/vscode-langservers-extracted to get vscode-html-language-server, vscode-css-language-server, and vscode-eslint-language-server.

    Note: For ESLint support, you must also have eslint installed as a dev dependency in your project.

    npm install -g @zed-industries/vscode-langservers-extracted
    pnpm install -g @zed-industries/vscode-langservers-extracted
    bun install -g @zed-industries/vscode-langservers-extracted
    
    # Project requirement
    npm install --save-dev eslint
  5. Patch Claude Code to enable LSP support

    main

    To make Claude Code's built-in LSP support usable, you must patch your installation. Use tweakcc, which automatically detects whether your Claude Code installation is via npm or native and applies the necessary patches.

    tweakcc also provides additional customization options such as customizing system prompt parts, creating new themes, and changing thinking verbs.

    npx tweakcc --apply
  6. Install JavaScript/TypeScript LSPs (typescript-language-server or vtsls)

    main

    To use JavaScript or TypeScript support, you must install either typescript-language-server or vtsls globally, along with the typescript package. Do not install both; they cover the same languages.

    Ensure the chosen executable is in your PATH.

    # Option 1: typescript-language-server
    npm install -g typescript-language-server typescript
    # or
    pnpm install -g typescript-language-server typescript
    # or
    bun install -g typescript-language-server typescript
    
    # Option 2: vtsls
    npm install -g @vtsls/language-server typescript
    # or
    pnpm install -g @vtsls/language-server typescript
    # or
    bun install -g @vtsls/language-server typescript
  7. Install Python LSPs (pyright or ty)

    main

    You can choose between pyright for type checking or ty (Astral's type checker) for speed. Ensure the executable is in your PATH. ty automatically detects pyproject.toml for configuration.

    # Install pyright
    npm install -g pyright
    # or
    pnpm install -g pyright
    # or
    bun install -g pyright
    
    # Install ty
    uv tool install ty
    # or
    pip install ty