LSP workspaceSymbol operation sends empty query, making it unusable
Summary
The workspaceSymbol LSP operation is effectively broken because it sends an empty query: "" parameter to the LSP server, ignoring the filePath, line, and character parameters entirely.
Version
2.1.22
Details
Looking at the implementation in cli.js, the LSP request builder handles operations differently:
switch(A.operation){
case"goToDefinition":
return{method:"textDocument/definition",params:{textDocument:{uri:q},position:Y}};
case"findReferences":
return{method:"textDocument/references",params:{textDocument:{uri:q},position:Y,context:{includeDeclaration:!0}}};
case"hover":
return{method:"textDocument/hover",params:{textDocument:{uri:q},position:Y}};
// ... other operations use position:Y ...
case"workspaceSymbol":
return{method:"workspace/symbol",params:{query:""}}; // <-- BUG: empty query, ignores all inputs
}
Operations like goToDefinition, findReferences, hover, etc. all use the position parameter built from the provided line and character. But workspaceSymbol ignores these entirely and sends an empty query string.
Expected Behavior
workspaceSymbol should either:
- Accept a
queryparameter in the schema for the symbol name to search for, OR - Extract the symbol at the given cursor position (like other operations do) and use that as the query
Impact
This makes workspace-wide symbol search impossible. Users cannot search for a function/class by name across the codebase using LSP.
Discoverability Issue
Additionally, because the tool schema requires filePath, line, and character for ALL operations (including workspaceSymbol), it's not intuitive that workspaceSymbol is meant for workspace-wide search. The AI assistant tends to fall back to grep/glob for symbol lookup rather than attempting to use workspaceSymbol, since:
- The schema suggests you need a file position (which defeats the purpose of workspace search)
- When attempted, it returns no results (due to the empty query)
A query parameter specific to workspaceSymbol would make the interface clearer and the operation actually functional.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗