LSP tool returns empty results despite server responding correctly (Windows)
Bug Description
LSP tool operations (hover, documentSymbol, goToDefinition, findReferences) always return "No results" messages, even though the language server (Pyright) responds with valid data. Diagnostics (passive publishDiagnostics notifications) work correctly.
Environment
- Claude Code version: 2.1.72
- OS: Windows 11
- LSP server: Pyright 1.1.408 (via
node langserver.index.js --stdio) - Plugin sources tested: Official (
claude-plugins-official), community (boostvolt/claude-code-lsps), and local custom plugin — all exhibit the same behavior
Steps to Reproduce
- Install any pyright LSP plugin (official or third-party)
- Set
ENABLE_LSP_TOOL=1in~/.claude/settings.jsonenv - Restart Claude Code
- Open a Python project
- Use the LSP tool:
hover,documentSymbol, orgoToDefinitionon any Python file
Expected Behavior
LSP tool should return the hover info, symbols, or definition location from Pyright's response.
Actual Behavior
All LSP tool operations return generic "No results" messages:
hover→ "No hover information available"documentSymbol→ "No symbols found in document"goToDefinition→ "No definition found"
Debug Log Evidence
Debug logs confirm the LSP protocol communication is working correctly:
[LSP PROTOCOL plugin:pyright:python] Sending request 'textDocument/hover - (3)'
[LSP PROTOCOL plugin:pyright:python] Received response 'textDocument/hover - (3)' in 57ms.
[LSP PROTOCOL plugin:pyright:python] Sending request 'textDocument/documentSymbol - (2)'
[LSP PROTOCOL plugin:pyright:python] Received response 'textDocument/documentSymbol - (2)' in 37ms.
Responses arrive in 37-353ms, but Claude Code displays "No results" to the user.
Manual Verification
I wrote a Node.js script to manually spawn pyright-langserver and send the same LSP requests. Pyright returns correct results:
hover → (function) def hello(name: str) -> str
documentSymbol → Found hello, MY_PATH, result symbols with correct ranges
goToDefinition → Correctly resolves Path to pathlib/__init__.pyi
This proves Pyright is working correctly and the bug is in Claude Code's LSP response parsing/handling layer.
Additional Notes
- Diagnostics work: Passive
textDocument/publishDiagnosticsnotifications are correctly received and displayed (e.g., "Import could not be resolved", unused variable warnings) - Multiple plugin formats tested: Tried
lspServersinline inmarketplace.json, standalone.lsp.json, andplugin.json— all three code paths produce the same behavior - Windows-specific spawn issue: On Windows,
pyright-langserver(a bash shim) cannot be spawned byuv_spawn. Workaround: usenodewith the full path tolangserver.index.js. This resolves the spawn issue but the response parsing bug remains. Total LSP servers loaded: Was initially0untilENABLE_LSP_TOOL=1was set, then correctly shows loaded servers.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗