#Zig-Extension for Zed and zls problems

1 messages · Page 1 of 1 (latest)

lavish cipher
#

I'm using Zed and the zig extension to code in Zig. But I have a strange problem and perhaps somebody here is using Zed too and knows a fix.
If I start Zed by clicking on it's icon, it says it couldn't load zls. But it is in the path and if I do echo $PATH, the path to zls is in the output.
If I start zed from a terminal window, it works.
Configuration in settings.json looks like this:

"languages": {
    "zig": {
      "formatter": "language_server",
      "language_servers": [
        "zls"
      ]
    }
  },
  "lsp": {
    "zls": {
      "settings": {
        "enable_build_on_save": false,
        "enable_autofix": false,
        "warn_style": true,
        "highlight_global_var_declarations": true
      }
    }
  }

Any ideas on where to look or what to change?

slim scaffold
#

when you click on its icon zed might have a different PATH than when you spawn it from a terminal? how did you add zls to your PATH?

lavish cipher
#

it's in bashrc and in KDE plasma environment file. And, as I said, if I output the path from within Zed, it is in there.

#

Also, in the start log in zed, it is saying it starts zls:

2024-09-29T21:40:26.032503904+02:00 [INFO] starting language server process. binary path: "/home/totto/bin/zls/bin/zls", working directory: "/home/totto/repositories/abysshack", args: []
2024-09-29T21:40:26.050383975+02:00 [WARN] unhandled capability registration: Registration { id: "register-workspace/didChangeConfiguration", method: "workspace/didChangeConfiguration", register_options: None }
2024-09-29T21:40:26.05609885+02:00 [INFO] Language server with id 1 sent unhandled notification workspace/semanticTokens/refresh:
null
2024-09-29T21:40:26.119322684+02:00 [INFO] Language server with id 1 sent unhandled notification workspace/semanticTokens/refresh:
null
slim scaffold
#

when you output the path from within zed, it's probably launching bash in the terminal? unless there's a way to show the path in zed that's not in a terminal?

#

oh that's weird

lavish cipher
#

exactly 😉

#

oh....wait a minute....I found a difference....if I start it from the icon, the open log says this:

2024-09-29T21:52:03.367241738+02:00 [INFO] starting language server process. binary path: "/home/totto/.local/share/zed/extensions/work/zig/zls-0.13.0/zls"
#

so it's starting a different zls then o.O

#

and your assumption, that the terminal starts a bash and then executes my .bashrc sounds very reasonable....so I tricked myself at that point...
I'll have to find a way, that KDE respects my .bashrc I guess