LSP position-based operations return empty on Windows (hover, documentSymbol, goToDefinition)
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-serverv5.1.3 (installed globally via npm) - Plugin:
typescript-lsp@claude-plugins-officialv1.0.0 - TypeScript: v5.9.3 (global)
ENABLE_LSP_TOOLS: Set to1viasetx(persistent Windows env var)
Steps to Reproduce
- Install
typescript-language-serverandtypescriptglobally - Enable
typescript-lsp@claude-plugins-officialplugin - Set
ENABLE_LSP_TOOLS=1as a Windows environment variable - Restart Claude Code from a fresh terminal
- 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 containsREADME.mdandLICENSE— the LSP config comes frommarketplace.json - The
marketplace.jsoncorrectly defines thelspServersconfig with"command": "typescript-language-server"and"args": ["--stdio"]
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗