[BUG] LSP workspaceSymbol operation sends empty query parameter

Open 💬 31 comments Opened Jan 9, 2026 by SShadowS

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 position
  • goToDefinition - jump to definition at a position
  • documentSymbol - list symbols in a file
  • hover - 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

  1. Set environment variable ENABLE_LSP_TOOL=1
  2. Open Claude Code in a project with an LSP configured
  3. Ask Claude: "Use the LSP workspaceSymbol operation to find symbols named 'Customer'"
  4. Claude will call: LSP(operation: "workspaceSymbol", file: "some/file.al")
  5. Result: 0 symbols returned

Method 2: Via AL LSP Wrapper (with logging)

  1. Install the AL LSP wrapper from SShadowS/claude-code-lsps
  2. Check the log file at %TEMP%/al-lsp-wrapper.log
  3. Ask Claude to search for workspace symbols
  4. Log shows:

``
handle_workspace_symbol called
DEBUG params: {'query': ''}
Workspace symbol query: ''
``

  1. The query parameter is empty - Claude Code never passes the search term

Method 3: Compare with Working Operations

  1. documentSymbol works: LSP(operation: "documentSymbol", file: "path/to/file.al") → Returns symbols
  2. findReferences works: LSP(operation: "findReferences", file: "...", line: 10, character: 5) → Returns references
  3. workspaceSymbol fails: 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

View original on GitHub ↗

31 Comments

SShadowS · 6 months ago

See full technical analysis and wrapper mitigations: https://github.com/SShadowS/claude-code-lsps/blob/main/KnownIssues.md

acushner-rippling · 5 months ago

it says "platform:windows" but this is also happening on mac obvs

pdebuitlear · 4 months ago

Still reproduces on 2.1.50

anshulongithub · 4 months ago
Still reproduces on 2.1.50

+1

SShadowS · 4 months ago

+1

pdebuitlear · 4 months ago

Still reproduces on 2.1.56 (using jdtls-lsp)

pavelpp · 4 months ago

+1

marianososto · 4 months ago

+1

Green7 · 4 months ago

+1

pdebuitlear · 4 months ago

still reproduces on v2.1.71

burner1024 · 4 months ago

+1...

cptshrk108 · 4 months ago

+1

burner1024 · 4 months ago

Keep it alive dudes, damn decepticons keep closing issues after 1 week here.

githoober · 4 months ago

This effectively renders LSP semi-useless. +1

nikitautiu · 4 months ago

Can confirm. The basically prevents LSP from being useful at reducing context usage.

hellvinz · 3 months ago

👍

pdebuitlear · 3 months ago

Still reproducing on v2.1.87

abhishekvijaykumar94 · 3 months ago

+1

erhanacunal · 3 months ago

+1

pdebuitlear · 3 months ago

still reproducing in v2.1.97

SimoneDoc · 3 months ago

+1

Huffworks · 3 months ago

Still reproduces on 2.1.101 (pyright-lsp 1.0.0, pyright 1.1.408).

vrppaul · 2 months ago

Still reproduces on 2.1.114. Here's the exact code path, for whoever picks this up:

In the Bun-compiled binary, function L81 builds the LSP request per operation. Every operation except workspaceSymbol derives textDocument + position from the tool's filePath / line / character inputs. workspaceSymbol is hardcoded:

case "workspaceSymbol":
  return { method: "workspace/symbol", params: { query: "" } };

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:

case "workspaceSymbol": {
  const word = pA7(H.filePath, H.line - 1, H.character - 1) ?? "";
  return { method: "workspace/symbol", params: { query: word } };
}

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.

mlelas · 2 months ago

still on 2.1.123 + Ubuntu

jose-bittacora · 2 months ago

Same here, Kubuntu + Claude Code 2.1.132

Chorss · 2 months ago

Still reproducing on v2.1.132 — jdtls (Java)

Environment:

  • Claude Code: 2.1.132
  • Plugin: jdtls-lsp@1.0.0
  • OS: Linux (Ubuntu 24.04)
  • LSP server: Eclipse JDT.LS (via redhat.java VS Code extension)

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.

pdebuitlear · 2 months ago

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.

SixFive7 · 1 month ago

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.exe v2.1.146, the LSP request builder still emits a literal empty query for this one operation:

case "workspaceSymbol": return { method: "workspace/symbol", params: { query: "" } };

Every other operation derives { textDocument: { uri }, position } from the line/character args; workspaceSymbol alone sends neither — the line/character inputs 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 sent workspace/symbol directly after waiting for projectInitializationComplete:

| 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 for goToDefinition/hover); routing that token into the workspace/symbol params — or adding an optional query field 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.

SShadowS · 1 month ago

Should be solve in the latest version, havn't tested it yet. You?

chuckfranco · 1 month ago
Should be solve in the latest version, havn't tested it yet. You?

just tested it -- it now works!

SShadowS · 1 month ago

Confirmed fixed on 2.1.162 (Windows). workspaceSymbol now takes a query and passes it through; real queries return matches. Good to close.