Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IntelliSense / auto-complete not working for Zig / zls Language Server #9325

Closed
1 task done
MrBuddyCasino opened this issue Mar 14, 2024 · 9 comments
Closed
1 task done
Labels
bug [core label] language server failure Language server doesn't work as expected language server An umbrella label for all language servers language An umbrella label for all programming languages syntax behaviors zig Zig programming language support

Comments

@MrBuddyCasino
Copy link

MrBuddyCasino commented Mar 14, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Zed does not show any suggestions. The same language server works fine in VsCode.

VsCode:
image

Zed:
image

I have seen #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```
@MrBuddyCasino MrBuddyCasino added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Mar 14, 2024
@JosephTLyons JosephTLyons added language An umbrella label for all programming languages syntax behaviors language server failure Language server doesn't work as expected language server An umbrella label for all language servers zig Zig programming language support and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Mar 14, 2024
@timurguvenkaya
Copy link

Experiencing the same issue

@lilylilylily123
Copy link

Experiencing the same issue - but with the Go language server

@Angluca
Copy link

Angluca commented Apr 13, 2024

Same issue .. T_T

@mrnugget
Copy link
Member

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.

@MrBuddyCasino
Copy link
Author

MrBuddyCasino commented Apr 15, 2024

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.

@mrnugget
Copy link
Member

FWIW, I also just merged this to help with zls/zig setups: #10559

@maherbeg
Copy link

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.

@mrnugget
Copy link
Member

@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: #10224 (comment)

@notpeter
Copy link
Member

notpeter commented Sep 4, 2024

Going through some old issues and I believe this is now fixed. I am able to get zls completions working out of the box.
Screenshot 2024-09-04 at 11 01 45

If you are still running into trouble or I've misunderstood this issue, please comment and I'm happy to reopen. Thanks!

@notpeter notpeter closed this as completed Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] language server failure Language server doesn't work as expected language server An umbrella label for all language servers language An umbrella label for all programming languages syntax behaviors zig Zig programming language support
Projects
None yet
Development

No branches or pull requests

8 participants