[BUG] LSP workspaceSymbol operation sends empty query parameter
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: LSP workspaceSymbol operation sends empty query parameter
Description
The Claude Code LSP tool's workspaceSymbol operation does not pass a search query to the language server, making it non-functional. The tool sends {"query": ""} (empty string) instead of a user-provided search term.
Expected Behavior
workspaceSymbol should accept a search query parameter (e.g., "Customer", "Sales") and pass it to the language server to search for symbols across the workspace.
Actual Behavior
The LSP tool sends an empty query:
{"query": ""}
This results in no symbols being found, regardless of the codebase content.
Evidence
From the AL Language Server wrapper logs:
handle_workspace_symbol called
DEBUG params: {'query': ''}
Workspace symbol query: ''
Root Cause
The LSP tool interface appears designed for file+position operations (filePath, line, character), which work correctly for:
findReferences- find usages at a positiongoToDefinition- jump to definition at a positiondocumentSymbol- list symbols in a filehover- get info at a position
However, workspaceSymbol requires a different parameter - a search query string - which isn't exposed in the current tool interface.
What Should Happen?
Suggested Fix
Add a query parameter to the LSP tool for workspaceSymbol operations. Example interface:
LSP(operation: "workspaceSymbol", query: "Customer")
Or alternatively, repurpose an existing parameter when operation is workspaceSymbol.
Workaround
Users can use documentSymbol to list symbols in a specific file, or use Grep to search for symbol names across the workspace.
Error Messages/Logs
Steps to Reproduce
Method 1: Direct LSP Tool Usage
- Set environment variable
ENABLE_LSP_TOOL=1 - Open Claude Code in a project with an LSP configured
- Ask Claude: "Use the LSP workspaceSymbol operation to find symbols named 'Customer'"
- Claude will call:
LSP(operation: "workspaceSymbol", file: "some/file.al") - Result: 0 symbols returned
Method 2: Via AL LSP Wrapper (with logging)
- Install the AL LSP wrapper from
SShadowS/claude-code-lsps - Check the log file at
%TEMP%/al-lsp-wrapper.log - Ask Claude to search for workspace symbols
- Log shows:
````
handle_workspace_symbol called
DEBUG params: {'query': ''}
Workspace symbol query: ''
- The query parameter is empty - Claude Code never passes the search term
Method 3: Compare with Working Operations
documentSymbolworks:LSP(operation: "documentSymbol", file: "path/to/file.al")→ Returns symbolsfindReferencesworks:LSP(operation: "findReferences", file: "...", line: 10, character: 5)→ Returns referencesworkspaceSymbolfails: Always returns 0 symbols regardless of codebase content
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.2
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
I need it to fully support workspaceSymbol in this LSP https://github.com/SShadowS/claude-code-lsps
31 Comments
See full technical analysis and wrapper mitigations: https://github.com/SShadowS/claude-code-lsps/blob/main/KnownIssues.md
it says "platform:windows" but this is also happening on mac obvs
Still reproduces on 2.1.50
+1
+1
Still reproduces on 2.1.56 (using jdtls-lsp)
+1
+1
+1
still reproduces on v2.1.71
+1...
+1
Keep it alive dudes, damn decepticons keep closing issues after 1 week here.
This effectively renders LSP semi-useless. +1
Can confirm. The basically prevents LSP from being useful at reducing context usage.
👍
Still reproducing on v2.1.87
+1
+1
still reproducing in v2.1.97
+1
Still reproduces on 2.1.101 (pyright-lsp 1.0.0, pyright 1.1.408).
Still reproduces on 2.1.114. Here's the exact code path, for whoever picks this up:
In the Bun-compiled binary, function
L81builds the LSP request per operation. Every operation exceptworkspaceSymbolderivestextDocument+positionfrom the tool'sfilePath/line/characterinputs.workspaceSymbolis hardcoded:The same file already defines pA7(filePath, line, character) — a synchronous reader that returns the identifier at the cursor. It's used for the tool's display rendering (the symbol: "X" label in the tool card), but not wired into the protocol call. Minimal fix:
Verified via a standalone LSP client against ty 0.0.31: workspace/symbol with query: "Embedder" returns 8 matches; query: "" returns null (matches the observed behavior). The bug is entirely on Claude Code's side.
still on 2.1.123 + Ubuntu
Same here, Kubuntu + Claude Code 2.1.132
Still reproducing on v2.1.132 — jdtls (Java)
Environment:
Observed behavior:
documentSymbol (per-file) works correctly and returns all class/method/field symbols. workspaceSymbol always returns empty — confirmed via the LSP server logs that it receives {"query": ""}.
Impact:
The main value of workspaceSymbol over documentSymbol is cross-file symbol lookup without having to read whole files into context. With the empty query bug, every workspace-wide symbol search falls back to grep or reading multiple files manually — which defeats the token-saving purpose of having an
LSP tool in the first place.
Workaround in use: Bash + grep -rn on src/main/java.
The root cause analysis by @vrppaul (hardcoded query: "" in the workspaceSymbol case of the request builder) matches exactly what I observe. The proposed one-liner fix looks correct.
This is not fixed for workspaceSymbol using jdtls on windows, all other LSP tools work in jdtls using Claude Code v2.1.138 except workspaceSymbol.
Still present in v2.1.146 (native binary), and confirmed 100% client-side — the language server is fine.
Two additions to this thread: confirmation it's unfixed in the current native build, plus an empirical test that I think settles whether passing a real query is sufficient.
1) Still hardcoded in the latest build. In the native
claude.exev2.1.146, the LSP request builder still emits a literal empty query for this one operation:Every other operation derives
{ textDocument: { uri }, position }from theline/characterargs;workspaceSymbolalone sends neither — theline/characterinputs are silently discarded.2) The server side is provably fine — the empty query is the _sole_ cause. I drove the same Roslyn server (
Microsoft.CodeAnalysis.LanguageServer), launched exactly as Claude Code launches it, and sentworkspace/symboldirectly after waiting forprojectInitializationComplete:| query sent | results |
|---|---|
|
"DistanceCalculator"| 18 ||
"RecognizeAsync"| 6 ||
"IOcrProvider"| 1 ||
""(what Claude Code sends) | 0 |Rich results for a real query, nothing for the empty string — matching the gopls example in #30948. No indexing/warm-up factor was involved: the project was fully loaded (every other operation worked at the same moment).
3) Minimal fix. The client already extracts the identifier at
line/character(it's used to build the display label forgoToDefinition/hover); routing that token into theworkspace/symbolparams — or adding an optionalqueryfield to the LSP tool schema, as proposed in #30948 — is sufficient.Environment: Windows 11, C# via
Microsoft.CodeAnalysis.LanguageServer, Claude Code native binary v2.1.146.Should be solve in the latest version, havn't tested it yet. You?
just tested it -- it now works!
Confirmed fixed on 2.1.162 (Windows).
workspaceSymbolnow takes aqueryand passes it through; real queries return matches. Good to close.