zed icon indicating copy to clipboard operation
zed copied to clipboard

Zig: project symbol search not working

Open lvignoli opened this issue 1 year ago • 2 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

Project symbol search (cmd+T) returns no symbol at all. Outline and outline panel of the current file work correctly.

I have zig 0.13.0 and zls 0.13.0 installed locally.

LSP logs for zls with RPC messages during the symbol search
// Send:
{"jsonrpc":"2.0","id":8,"method":"workspace/symbol","params":{"query":""}}
// Receive:
{"jsonrpc":"2.0","id":8,"result":null}
// Send:
{"jsonrpc":"2.0","id":9,"method":"workspace/symbol","params":{"query":"s"}}
// Receive:
{"jsonrpc":"2.0","id":9,"result":null}
// Send:
{"jsonrpc":"2.0","id":10,"method":"workspace/symbol","params":{"query":"sq"}}
// Receive:
{"jsonrpc":"2.0","id":10,"result":null}
// Send:
{"jsonrpc":"2.0","id":11,"method":"workspace/symbol","params":{"query":"sqi"}}
// Receive:
{"jsonrpc":"2.0","id":11,"result":null}
// Send:
{"jsonrpc":"2.0","id":12,"method":"workspace/symbol","params":{"query":"sqid"}}
// Receive:
{"jsonrpc":"2.0","id":12,"result":null}
// Send:
{"jsonrpc":"2.0","id":13,"method":"workspace/symbol","params":{"query":"sqids"}}
// Receive:
{"jsonrpc":"2.0","id":13,"result":null}
```

Environment

Zed: v0.144.2 (Zed Preview) OS: macOS 14.4.1 Memory: 16 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log

2024-07-12T13:24:04.070683Z [INFO] Initializing default prettier with plugins {}
2024-07-12T13:24:04.0709Z [INFO] starting language servers for Zig: zls
2024-07-12T13:24:08.322357Z [INFO] Initializing default prettier with plugins {}
2024-07-12T13:24:08.322572Z [INFO] starting language servers for Zig: zls
2024-07-12T13:24:08.470152Z [INFO] Initializing default prettier with plugins {}
2024-07-12T13:24:08.470295Z [INFO] starting language servers for Zig: zls
2024-07-12T13:24:08.809276Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:24:09.65751Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:24:09.752626Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:24:09.834301Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:24:09.936804Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:24:10.052019Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:24:10.118453Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:24:11.833134Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:24:12.085509Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:24:12.174744Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:24:12.315617Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:24:12.432159Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:24:12.528078Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:24:13.714884Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:24:14.999393Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:24:33.933213Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:24:34.270237Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:24:34.351186Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:24:35.423499Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:24:35.952205Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:24:36.192674Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:24:36.399044Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:24:36.445633Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:24:36.535213Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:24:43.670965Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:26:16.43752Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:26:16.832303Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:26:16.884526Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:26:17.647742Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:26:17.772304Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:26:18.070708Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:26:18.24531Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:26:18.593881Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:26:18.66475Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:26:18.784591Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:26:18.999981Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:26:19.330568Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:26:19.445665Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:26:19.497787Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:26:48.778761Z [INFO] stopping language server zls
2024-07-12T13:26:48.78929Z [ERROR] oneshot canceled
2024-07-12T13:26:48.789972Z [INFO] starting language servers for Zig: zls
2024-07-12T13:26:48.790121Z [INFO] starting language server "zls", path: "[[REDACTED]]/sqids/sqids-zig", id: 3
2024-07-12T13:26:49.032517Z [INFO] starting language server. binary path: "/opt/homebrew/bin/zls", working directory: "[[REDACTED]]/sqids/sqids-zig", args: []
2024-07-12T13:26:49.228806Z [INFO] Language server with id 3 sent unhandled notification workspace/semanticTokens/refresh:
null
2024-07-12T13:26:49.328637Z [INFO] Language server with id 3 sent unhandled notification workspace/semanticTokens/refresh:
null
2024-07-12T13:27:01.634594Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:27:02.951586Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:27:03.026813Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:27:03.198904Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:27:03.334431Z [ERROR] Unhandled method workspace/symbol
2024-07-12T13:27:03.415374Z [ERROR] Unhandled method workspace/symbol

lvignoli avatar Jul 12 '24 13:07 lvignoli

Upstream issue

  • https://github.com/zigtools/zls/issues/397

llogick avatar Jul 13 '24 00:07 llogick

Well spotted! Maybe we can close this one then?

lvignoli avatar Jul 13 '24 10:07 lvignoli

I'm going to close this because it's not currently supported upstream by ZLS:

  • https://github.com/zigtools/zls/issues/397

When zls gets symbols support Zed should pick it up like with other language servers. Thanks all!

notpeter avatar Sep 04 '24 15:09 notpeter