[BUG] LSP Tool returns "No LSP server available" despite correct plugin configuration (v2.0.76)
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?
## Bug Description
The LSP tool always returns "No LSP server available for file type: .cs" (and .ts) even when:
- LSP plugins are correctly structured and enabled
- LSP language servers are installed and accessible
- The gist patch has been applied
## Environment
- Claude Code Version: 2.0.76
- OS: macOS Darwin 25.1.0
- Node.js: v24.10.0
- npm: 11.6.0
- Installation: Local (~/.claude/local/)
## LSP Servers Installed
```bash
$ which csharp-ls
/Users/hiten/.dotnet/tools/csharp-ls
$ csharp-ls --version
csharp-ls, 0.21.0.0
$ which typescript-language-server
/opt/homebrew/bin/typescript-language-server
Plugin Configuration
Project Settings (.claude/settings.json)
{
"enabledPlugins": {
"./.claude/plugins/typescript-lsp": true,
"./.claude/plugins/csharp-lsp": true
}
}
Plugin Structure (Correct)
.claude/plugins/csharp-lsp/
├── .claude-plugin/
│ └── plugin.json
└── .lsp.json
plugin.json
{
"name": "csharp-lsp",
"version": "1.0.0",
"description": "C# Language Server for code intelligence",
"author": { "name": "Local Plugin" },
"lspServers": "./.lsp.json"
}
.lsp.json
{
"csharp": {
"command": "csharp-ls",
"args": [],
"extensionToLanguage": { ".cs": "csharp" },
"restartOnCrash": true,
"maxRestarts": 5
}
}
Patch Script Issue
The community patch from https://gist.github.com/Zamua/f7ca58ce5dd9ba61279ea195a01b190c reports "Already patched" but does not actually fix the issue.
Root Cause: The patch detection logic uses patterns (let{servers:_S}=await and .set(_N,_I)) that exist in the LSP JSON-RPC message connection code (line 1246), NOT in the LspServerManager's initialize() function.
# Patch markers found at wrong location (JSON-RPC code, not initialize function)
$ grep -n 'servers:_S' cli.js
1246:... (JSON-RPC message handling code)
This is a false positive detection causing the patch to:
- Report "Already patched" when it isn't
- Modify unrelated JSON-RPC code instead of the LSP manager
What Should Happen?
Expected Behavior
LSP operations should work when plugins are correctly configured:
- goToDefinition should find symbol definitions
- findReferences should locate all usages
- documentSymbol should list file symbols
- hover should show type information
Actual Behavior
All LSP operations return:
No LSP server available for file type: .cs
Error Messages/Logs
Steps to Reproduce
Steps to Reproduce
- Install Claude Code v2.0.76
- Install csharp-ls via dotnet tool install --global csharp-ls
- Create LSP plugin structure as shown above
- Enable plugin in project settings
- Restart Claude Code
- Run any LSP operation on a .cs file
Additional Context
The underlying issue appears to be that the LspServerManager.initialize() function is empty/non-functional and never loads LSP servers from enabled plugins. The community patch attempts to fix this but has a detection bug.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
v2.0.76
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Warp
Additional Information
Additional Context
The underlying issue appears to be that the LspServerManager.initialize() function is empty/non-functional and never loads LSP servers from enabled plugins. The community patch attempts to fix this but has a detection bug.
Suggested Fix
The patch script's detection logic needs to be updated to correctly identify the LspServerManager's initialize() function rather than matching patterns in unrelated JSON-RPC code.
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗