scalameta / metals

Scala language server with rich IDE features 🚀
https://scalameta.org/metals/
Apache License 2.0
2.1k stars 334 forks source link

`workspace/symbol` with an empty query returns no symbols #6833

Open WeetHet opened 1 month ago

WeetHet commented 1 month ago

Describe the bug

  1. Create a scala file and hook up scala-cli: scala-cli setup-ide ..
  2. Send a workspace/symbol request to metals using an editor of your choice (I use Zed), with the following contents (in case of Zed by pressing Cmd+T)
    {"jsonrpc":"2.0","id":200,"method":"workspace/symbol","params":{"query":""}}
  3. Receive:
    {"jsonrpc":"2.0","id":200,"result":[]}

Expected behavior

According to the LSP specification, this request should return all symbols for the workspace (definition):

Clients may send an empty string here to request all symbols.

Operating system

macOS

Editor/Extension

Other

Version of Metals

v1.3.5

Extra context or search terms

No response

tgodzik commented 1 month ago

Thanks for reporting! This was done on purpose, but I think we some recent changes we can improve that.