zed
zed copied to clipboard
IntelliSense / auto-complete not working for Zig / zls Language Server
Check for existing issues
- [X] Completed
Describe the bug / provide steps to reproduce it
Zed does not show any suggestions. The same language server works fine in VsCode.
VsCode:
Zed:
I have seen https://github.com/zed-industries/zed/issues/7198, but my version is supposed to contain the fix - regression?
Environment
Zed: v0.126.2 (Zed) OS: macOS 12.7.1 Memory: 16 GiB Architecture: x86_64
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.
2024-03-13T14:31:48+01:00 [INFO] Opening main db
2024-03-13T14:31:48+01:00 [ERROR] crates/settings/src/settings_file.rs:76: EOF while parsing a value at line 1 column 0
2024-03-13T14:31:48+01:00 [ERROR] crates/extension/src/extension_store.rs:195: No such file or directory (os error 2)
2024-03-13T14:31:48+01:00 [ERROR] crates/zed/src/zed.rs:569: EOF while parsing a value at line 1 column 0
2024-03-13T14:31:48+01:00 [INFO] set environment variables from shell:/bin/zsh, path:/usr/local/opt/[email protected]/bin:/Users/michaelboeckling/Documents/Tools/terraform/:/Users/michaelboeckling/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS
2024-03-13T14:31:48+01:00 [INFO] Opening main db
2024-03-13T14:31:48+01:00 [ERROR] crates/zed/src/main.rs:1022: Is a directory (os error 21)
2024-03-13T14:31:48+01:00 [ERROR] crates/zed/src/main.rs:1022: Is a directory (os error 21)
2024-03-13T14:31:51+01:00 [INFO] Node runtime install_if_needed
2024-03-13T14:32:16+01:00 [INFO] starting language server. binary path: "/Users/michaelboeckling/Library/Application Support/Zed/node/node-v18.15.0-darwin-x64/bin/node", working directory: "/", args: ["/Users/michaelboeckling/Library/Application Support/Zed/copilot/copilot-v0.5.0/dist/agent.js", "--stdio"]
2024-03-13T14:32:17+01:00 [INFO] Language server with id 0 sent unhandled notification LogMessage:
{
"level": 0,
"message": "[DEBUG] [agent] [2024-03-13T13:32:17.595Z] Agent service starting",
"metadataStr": "[DEBUG] [agent] [2024-03-13T13:32:17.595Z]",
"extra": [
"Agent service starting"
]
}
2024-03-13T14:32:17+01:00 [INFO] Language server with id 0 sent unhandled notification client/registerCapability:
{
"registrations": [
{
"id": "1edd1059-6ac0-40c5-aa87-9ff208104311",
"method": "workspace/didChangeWorkspaceFolders",
"registerOptions": {}
}
]
}
2024-03-13T14:32:17+01:00 [INFO] Language server with id 0 sent unhandled notification LogMessage:
{
"level": 0,
"message": "[DEBUG] [agent] [2024-03-13T13:32:17.625Z] Telemetry initialized",
"metadataStr": "[DEBUG] [agent] [2024-03-13T13:32:17.625Z]",
"extra": [
"Telemetry initialized"
]
}
2024-03-13T14:32:35+01:00 [ERROR] crates/workspace/src/workspace.rs:4106: window not found
2024-03-13T14:32:35+01:00 [INFO] build git repository ".git"
2024-03-13T14:32:44+01:00 [INFO] Opening main db
2024-03-13T14:33:13+01:00 [INFO] installing extension java 0.0.3
2024-03-13T14:33:14+01:00 [ERROR] crates/extension/src/extension_store.rs:583: failed to load extension.json
Caused by:
No such file or directory (os error 2)
2024-03-13T14:33:14+01:00 [ERROR] crates/extension/src/extension_store.rs:583: failed to load extension.json
Caused by:
No such file or directory (os error 2)
2024-03-13T14:33:15+01:00 [ERROR] crates/extension/src/extension_store.rs:583: failed to load extension.json
Caused by:
No such file or directory (os error 2)
2024-03-13T14:33:15+01:00 [ERROR] crates/extension/src/extension_store.rs:583: failed to load extension.json
Caused by:
No such file or directory (os error 2)
2024-03-13T14:33:15+01:00 [ERROR] crates/extension/src/extension_store.rs:583: failed to load extension.json
Caused by:
No such file or directory (os error 2)
2024-03-13T14:33:15+01:00 [ERROR] crates/extension/src/extension_store.rs:583: failed to load extension.json
Caused by:
No such file or directory (os error 2)
2024-03-13T16:58:37+01:00 [INFO] reload git repository ".git"
2024-03-13T17:25:59+01:00 [INFO] Initializing default prettier with plugins {}
2024-03-13T17:25:59+01:00 [INFO] starting language server "yaml-language-server", path: "/Users/michaelboeckling/Documents/Privat/Freelancing/Projekte/Su\u{308}dleasing/Code/fachdaten-extraktor", id: 1
2024-03-13T17:25:59+01:00 [INFO] querying GitHub for latest version of language server "yaml-language-server"
2024-03-13T17:25:59+01:00 [INFO] Node runtime install_if_needed
2024-03-13T17:26:00+01:00 [INFO] Node runtime install_if_needed
2024-03-13T17:26:01+01:00 [INFO] Installing default prettier and plugins: [("prettier", "3.2.5")]
2024-03-13T17:26:01+01:00 [INFO] Node runtime install_if_needed
2024-03-13T17:26:02+01:00 [ERROR] unexpected item event after pane was dropped
2024-03-13T17:26:03+01:00 [INFO] checking if Zed already installed or fetching version for language server "yaml-language-server"
2024-03-13T17:26:03+01:00 [INFO] Node runtime install_if_needed
2024-03-13T17:26:03+01:00 [INFO] Initialized prettier with plugins: {}
2024-03-13T17:26:08+01:00 [INFO] Node runtime install_if_needed
2024-03-13T17:26:08+01:00 [INFO] starting language server. binary path: "/Users/michaelboeckling/Library/Application Support/Zed/node/node-v18.15.0-darwin-x64/bin/node", working directory: "/Users/michaelboeckling/Documents/Privat/Freelancing/Projekte/Su\u{308}dleasing/Code/fachdaten-extraktor", args: ["/Users/michaelboeckling/Library/Application Support/Zed/languages/yaml-language-server/node_modules/yaml-language-server/bin/yaml-language-server", "--stdio"]
2024-03-13T17:32:21+01:00 [INFO] downloaded update. path:"/var/folders/gy/m7gsskyn30vc5qshtz0glx140000gn/T/zed-auto-updateuVy1bh/Zed.dmg"
2024-03-13T17:47:29+01:00 [ERROR] crates/lsp/src/lsp.rs:691: oneshot canceled
2024-03-13T17:47:33+01:00 [INFO] ========== starting zed ==========
2024-03-13T17:47:33+01:00 [INFO] Opening main db
2024-03-13T17:47:33+01:00 [ERROR] crates/extension/src/extension_store.rs:267: Error("invalid type: string \"0.0.3\", expected struct ExtensionManifest", line: 3, column: 19)
2024-03-13T17:47:33+01:00 [INFO] set environment variables from shell:/bin/zsh, path:/usr/local/opt/[email protected]/bin:/Users/michaelboeckling/Documents/Tools/terraform/:/Users/michaelboeckling/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS
2024-03-13T17:47:34+01:00 [ERROR] crates/zed/src/zed.rs:619: EOF while parsing a value at line 1 column 0
2024-03-13T17:47:34+01:00 [INFO] Opening main db
2024-03-13T17:47:34+01:00 [INFO] building git repository, `.git` path in the worktree: ".git"
2024-03-13T17:47:34+01:00 [INFO] Opening main db
2024-03-13T17:47:34+01:00 [INFO] Node runtime install_if_needed
2024-03-13T17:47:35+01:00 [INFO] starting language server. binary path: "/Users/michaelboeckling/Library/Application Support/Zed/node/node-v18.15.0-darwin-x64/bin/node", working directory: "/", args: ["/Users/michaelboeckling/Library/Application Support/Zed/copilot/copilot-v0.5.0/dist/agent.js", "--stdio"]
2024-03-13T17:47:36+01:00 [INFO] Language server with id 0 sent unhandled notification LogMessage:
{
"level": 0,
"message": "[DEBUG] [agent] [2024-03-13T16:47:36.379Z] Agent service starting",
"metadataStr": "[DEBUG] [agent] [2024-03-13T16:47:36.379Z]",
"extra": [
"Agent service starting"
]
}
2024-03-13T17:47:36+01:00 [INFO] Language server with id 0 sent unhandled notification client/registerCapability:
{
"registrations": [
{
"id": "6b4b88d2-2518-4394-91f8-36a45ad56fae",
"method": "workspace/didChangeWorkspaceFolders",
"registerOptions": {}
}
]
}
2024-03-13T17:47:36+01:00 [INFO] Language server with id 0 sent unhandled notification LogMessage:
{
"level": 0,
"message": "[DEBUG] [agent] [2024-03-13T16:47:36.510Z] Telemetry initialized",
"metadataStr": "[DEBUG] [agent] [2024-03-13T16:47:36.510Z]",
"extra": [
"Telemetry initialized"
]
}
2024-03-13T17:47:55+01:00 [ERROR] crates/workspace/src/workspace.rs:4115: window not found
2024-03-13T17:47:59+01:00 [INFO] starting language server "zls", path: "/Users/michaelboeckling/Documents/Projekte/Zig", id: 1
2024-03-13T17:47:59+01:00 [WARN] failed to determine path for command "zls" in shell PATH "/usr/local/opt/[email protected]/bin:/usr/local/opt/[email protected]/bin:/Users/michaelboeckling/Documents/Tools/terraform/:/Users/michaelboeckling/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS": cannot find binary path
2024-03-13T17:47:59+01:00 [INFO] fetching latest version of language server "zls"
2024-03-13T17:48:00+01:00 [INFO] downloading language server "zls"
2024-03-13T17:48:04+01:00 [INFO] starting language server. binary path: "/Users/michaelboeckling/Library/Application Support/Zed/languages/zls/bin/zls", working directory: "/Users/michaelboeckling/Documents/Projekte/Zig", args: []
2024-03-14T09:22:28+01:00 [ERROR] crates/zed/src/zed.rs:619: EOF while parsing a value at line 1 column 0
2024-03-14T09:22:29+01:00 [INFO] open paths ["/Users/michaelboeckling/.config/zed/keymap.json"]
2024-03-14T09:22:29+01:00 [INFO] Initializing default prettier with plugins {}
2024-03-14T09:22:29+01:00 [INFO] starting language server "json-language-server", path: "/Users/michaelboeckling/.config/zed/keymap.json", id: 2
2024-03-14T09:22:29+01:00 [INFO] fetching latest version of language server "json-language-server"
2024-03-14T09:22:29+01:00 [INFO] Node runtime install_if_needed
2024-03-14T09:22:29+01:00 [ERROR] crates/zed/src/zed.rs:619: EOF while parsing a value at line 1 column 0
2024-03-14T09:22:31+01:00 [INFO] downloading language server "json-language-server"
2024-03-14T09:22:31+01:00 [INFO] Node runtime install_if_needed
2024-03-14T09:22:34+01:00 [INFO] Node runtime install_if_needed
2024-03-14T09:22:35+01:00 [INFO] starting language server. binary path: "/Users/michaelboeckling/Library/Application Support/Zed/node/node-v18.15.0-darwin-x64/bin/node", working directory: "/Users/michaelboeckling/.config/zed", args: ["/Users/michaelboeckling/Library/Application Support/Zed/languages/json-language-server/node_modules/vscode-json-languageserver/bin/vscode-json-languageserver", "--stdio"]
2024-03-14T09:22:38+01:00 [INFO] open paths ["/Users/michaelboeckling/.config/zed/settings.json"]
2024-03-14T09:22:38+01:00 [INFO] Initializing default prettier with plugins {}
2024-03-14T09:22:38+01:00 [INFO] Initializing default prettier with plugins {}
2024-03-14T09:22:38+01:00 [INFO] starting language server "json-language-server", path: "/Users/michaelboeckling/.config/zed/settings.json", id: 3
2024-03-14T09:22:38+01:00 [INFO] starting language server. binary path: "/Users/michaelboeckling/Library/Application Support/Zed/node/node-v18.15.0-darwin-x64/bin/node", working directory: "/Users/michaelboeckling/.config/zed", args: ["/Users/michaelboeckling/Library/Application Support/Zed/languages/json-language-server/node_modules/vscode-json-languageserver/bin/vscode-json-languageserver", "--stdio"]
2024-03-14T09:22:42+01:00 [ERROR] crates/lsp/src/lsp.rs:720: oneshot canceled
2024-03-14T09:22:42+01:00 [INFO] Initializing default prettier with plugins {}
2024-03-14T09:22:43+01:00 [ERROR] unexpected item event after pane was dropped
2024-03-14T09:22:43+01:00 [ERROR] crates/lsp/src/lsp.rs:720: oneshot canceled```
Experiencing the same issue
Experiencing the same issue - but with the Go language server
Same issue .. T_T
Can you open the language server logs (debug: open language server logs), select zls in top left and see whether there's any messages in there? You can also turn the RPC messages on in that dropdown and then check the logs again to see whether textDocument/completion is correctly sent.
This is weird. I just wanted to retrieve the logs you wanted. and now I get a suggestion context menu. Version is still 0.126.2.
FWIW, I also just merged this to help with zls/zig setups: https://github.com/zed-industries/zed/pull/10559
I'm having a similar issue with golang on the latest public Zed build. Code completion works on one project, but does not work on a different project where neovim / vscode work fine. LSP seems to be working because it can complete built ins (ctrl+space shows a list including built-ins like append etc.) but anything project related doesn't seem to complete in one of the projects.
The go environment variables from the terminal all look the same across both projects, and the logs seem to indicate loading packages.
@maherbeg can you create a separate ticket for this? This one is about Zig/zls. In that ticket, can you provide more information about the projects? Do they have a go.mod at the root folder? Or is it a monorepo? What do the logs say (see comments above)? Also, see this: https://github.com/zed-industries/zed/issues/10224#issuecomment-2042812083
Going through some old issues and I believe this is now fixed. I am able to get zls completions working out of the box.
If you are still running into trouble or I've misunderstood this issue, please comment and I'm happy to reopen. Thanks!