LSP position-based operations return empty on Windows (hover, documentSymbol, goToDefinition)

Resolved 💬 3 comments Opened Mar 9, 2026 by FZ1010 Closed Mar 12, 2026

Bug Description

All position-based LSP operations (hover, documentSymbol, goToDefinition, findReferences, goToImplementation, prepareCallHierarchy) return empty results on Windows, while workspace-level operations (workspaceSymbol) and diagnostics work correctly.

Environment

  • Claude Code version: 2.1.71
  • OS: Windows 11 Pro (10.0.26220)
  • Shell: Bash (MINGW64 / Git Bash), COMSPEC=cmd.exe
  • Language server: typescript-language-server v5.1.3 (installed globally via npm)
  • Plugin: typescript-lsp@claude-plugins-official v1.0.0
  • TypeScript: v5.9.3 (global)
  • ENABLE_LSP_TOOLS: Set to 1 via setx (persistent Windows env var)

Steps to Reproduce

  1. Install typescript-language-server and typescript globally
  2. Enable typescript-lsp@claude-plugins-official plugin
  3. Set ENABLE_LSP_TOOLS=1 as a Windows environment variable
  4. Restart Claude Code from a fresh terminal
  5. Run any position-based LSP operation on a TypeScript file

What Works

workspaceSymbol returns correct results:

Found 4 symbols in workspace:

src/lib/utils.ts:
  ClassValue (Variable) - Line 1
  clsx (Variable) - Line 1
  cn (Function) - Line 4
  twMerge (Variable) - Line 2

Diagnostics are generated correctly (TS2307 errors appear in system reminders).

This proves the LSP server starts and communicates with Claude Code successfully.

What Fails

All of these return empty or "not found" on the same file (src/lib/utils.ts):

| Operation | Input | Result |
|-----------|-------|--------|
| hover | line 4, char 17 (cn function) | "Tool ran without output or errors" |
| documentSymbol | any position | "No symbols found in document" |
| goToDefinition | line 1, char 10 (clsx import) | "No definition found" |
| findReferences | line 4, char 17 | "No references found" |
| goToImplementation | line 4, char 17 | "No definition found" |
| prepareCallHierarchy | line 4, char 17 | "No call hierarchy item found" |

Analysis

The pattern is clear: workspace-level queries work, document-level queries fail. This strongly suggests the LSP client in Claude Code is not sending textDocument/didOpen notifications to the language server, so the server has no document content to perform position-based queries against.

workspaceSymbol works because it doesn't require an open document — it queries the project index. All failing operations require the document to be open and synced via the LSP text document synchronization protocol.

Additional Notes

  • Tried both typescript-language-server (official plugin) and @vtsls/language-server — same result
  • Tried with both relative and absolute file paths — same result
  • Plugin directory (~/.claude/plugins/cache/claude-plugins-official/typescript-lsp/1.0.0/) only contains README.md and LICENSE — the LSP config comes from marketplace.json
  • The marketplace.json correctly defines the lspServers config with "command": "typescript-language-server" and "args": ["--stdio"]

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗