claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

LSP plugins not registering servers - LSP Manager initializes before plugins load

Open byosamah opened this issue 2 weeks ago • 2 comments

Bug Description

LSP servers from plugins are not being registered. The LSP Manager initializes with 0 servers before the plugins are loaded, so the .lsp.json configurations from LSP plugins are never picked up.

Environment

  • Claude Code Version: 2.0.76
  • OS: macOS (Darwin 24.6.0)
  • Plugin: vtsls@claude-code-lsps from boostvolt/claude-code-lsps marketplace

Steps to Reproduce

  1. Install vtsls globally: npm install -g vtsls
  2. Add the claude-code-lsps marketplace to settings.json:
    "extraKnownMarketplaces": {
      "claude-code-lsps": {
        "source": {
          "source": "github",
          "repo": "boostvolt/claude-code-lsps"
        }
      }
    }
    
  3. Enable the plugin: "vtsls@claude-code-lsps": true in enabledPlugins
  4. Restart Claude Code
  5. Try using the LSP tool on a TypeScript file

Expected Behavior

The LSP tool should work with TypeScript files using the vtsls language server.

Actual Behavior

LSP tool returns: No LSP server available for file type: .ts

Debug Log Evidence

The debug log shows the timing issue:

2025-12-27T16:09:35.099Z [DEBUG] [LSP MANAGER] Starting async initialization (generation 1)
2025-12-27T16:09:35.104Z [DEBUG] LSP server manager initialized successfully
2025-12-27T16:09:35.104Z [DEBUG] LSP notification handlers registered successfully for all 0 server(s)
2025-12-27T16:09:35.110Z [DEBUG] Plugin vtsls@claude-code-lsps version 1.0.0 already cached
2025-12-27T16:09:35.110Z [DEBUG] Loaded hooks from standard location for plugin vtsls

The LSP Manager completes initialization with 0 servers at 16:09:35.104, but the vtsls plugin doesn't finish loading until 16:09:35.110.

Plugin Configuration

The plugin's .lsp.json file at ~/.claude/plugins/cache/claude-code-lsps/vtsls/1.0.0/.lsp.json:

{
  "typescript": {
    "command": "vtsls",
    "args": ["--stdio"],
    "extensionToLanguage": {
      ".ts": "typescript",
      ".tsx": "typescriptreact",
      ".js": "javascript",
      ".jsx": "javascriptreact"
    }
  }
}

Additional Context

  • Plugin validates successfully: claude plugin validate returns "✔ Validation passed"
  • vtsls binary is installed and accessible: /usr/local/bin/vtsls (v0.3.0)
  • Multiple restarts of Claude Code don't resolve the issue
  • The same issue occurs with pyright@claude-code-lsps

Suggested Fix

The LSP Manager should either:

  1. Wait for plugins to load before initializing
  2. Re-scan for LSP configurations after plugins finish loading
  3. Support lazy initialization of LSP servers when first needed

byosamah avatar Dec 27 '25 17:12 byosamah