[BUG] Claude Code - LSP Tool Returns Empty Results Despite Server Responding Correctly (Windows)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Two issues with LSP Tool on Windows:
Issue #1 - ENOENT Error: Claude Code cannot spawn LSP servers because Node.js spawn() without shell: true cannot find .cmd or .ps1 files on Windows. Error: spawn typescript-language-server ENOENT
Issue #2 - Empty Results Bug: After creating .exe shims to fix Issue #1, the LSP tool returns "No symbols found", "No hover information", etc. for ALL document-level operations, even though the LSP server responds correctly with valid data. Only workspaceSymbol works.
This affects ALL tested LSP servers including the official typescript-lsp@claude-plugins-official plugin.
What Should Happen?
- LSP servers should spawn correctly on Windows (find
.cmdfiles or useshell: true) - Document-level operations (
documentSymbol,hover,findReferences,goToDefinition, etc.) should return the data that the LSP server provides
Direct test results (same file, same LSP server):
| Operation | Direct Test | Claude Code |
|-----------|------------|-------------|
| documentSymbol | ✅ 6 items | ❌ "No symbols found" |
| hover | ✅ "class UserService" | ❌ "No hover info" |
| references | ✅ 7 items | ❌ "No references" |
| workspaceSymbol | ✅ 256 items | ✅ 13 items |
Error Messages/Logs
**Issue #1 - ENOENT (before .exe shim fix):**
[ERROR] LSP server plugin:typescript-lsp:typescript failed to start: spawn typescript-language-server ENOENT
[ERROR] LSP server plugin:vtsls:typescript failed to start: spawn vtsls ENOENT
**Issue #2 - Server responds but Claude Code shows empty results:**
[DEBUG] [LSP PROTOCOL plugin:vtsls:typescript] Sending notification 'textDocument/didOpen'.
[DEBUG] LSP: Sent didOpen for C:\...\test-lsp.ts (languageId: typescript)
[DEBUG] [LSP PROTOCOL plugin:vtsls:typescript] Sending request 'textDocument/hover - (1)'.
[DEBUG] [LSP PROTOCOL plugin:vtsls:typescript] Received response 'textDocument/hover - (1)' in 4ms. ✅
[DEBUG] [LSP PROTOCOL plugin:vtsls:typescript] Sending request 'textDocument/documentSymbol - (2)'.
[DEBUG] [LSP PROTOCOL plugin:vtsls:typescript] Received response 'textDocument/documentSymbol - (2)' in 32ms. ✅
[DEBUG] [LSP PROTOCOL plugin:vtsls:typescript] Sending request 'textDocument/references - (3)'.
[DEBUG] [LSP PROTOCOL plugin:vtsls:typescript] Received response 'textDocument/references - (3)' in 61ms. ✅
**User sees:** "No symbols found", "No hover information available", "No references found"
Steps to Reproduce
Issue #1 (ENOENT):
- Fresh Windows 10/11 install
- Install Node.js and run:
npm install -g typescript-language-server typescript - In Claude Code settings, add:
"env": { "ENABLE_LSP_TOOL": "1" } - Enable
typescript-lsp@claude-plugins-officialplugin - Restart Claude Code
- Check debug logs at
~/.claude/debug/*.txt - Observe:
spawn typescript-language-server ENOENT
Issue #2 (Empty Results - after fixing Issue #1):
- Create
.exeshims for LSP servers using PowerShell:
$code = @"
using System;
using System.Diagnostics;
public class Shim {
public static int Main(string[] args) {
ProcessStartInfo info = new ProcessStartInfo();
info.FileName = "cmd.exe";
info.Arguments = "/c typescript-language-server.cmd " + string.Join(" ", args);
info.UseShellExecute = false;
Process p = Process.Start(info);
p.WaitForExit();
return p.ExitCode;
}
}
"@
Add-Type -TypeDefinition $code -OutputAssembly "C:\Users\USERNAME\AppData\Roaming\npm\typescript-language-server.exe" -OutputType ConsoleApplication
- Create test file
test-lsp.ts:
interface User {
id: number;
name: string;
}
class UserService {
private users: User[] = [];
addUser(user: User): void {
this.users.push(user);
}
}
function greet(user: User): string {
return `Hello, ${user.name}!`;
}
const service = new UserService();
- Restart Claude Code
- Use LSP tool:
documentSymbolon test-lsp.ts - Observe: "No symbols found in document"
- Use LSP tool:
workspaceSymbolon test-lsp.ts - Observe: Returns symbols correctly (this one works!)
- Check debug logs: Server received response in 32ms but user sees empty results
---
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.3
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
_No response_
This issue has 14 comments on GitHub. Read the full discussion on GitHub ↗