zigtools / zls-vscode

Deprecated, please use https://github.com/ziglang/vscode-zig
https://github.com/ziglang/vscode-zig
MIT License
85 stars 15 forks source link

Enhancement: Unknown command "fmt" #38

Closed enerdgumen closed 1 year ago

enerdgumen commented 2 years ago

When zig is installed via Snap the zig executable is a symlink (/snap/bin/zig --> /usr/bin/snap).

I get the following error when I run the formatter via VS code :

error: unknown command "fmt", see 'snap help'.

It seems that zls is not resolving symbolic links when fmt is invoked.

Setting the right path in the zls config solves the issue:

    "zig_lib_path": "/snap/zig/current/lib",
    "zig_exe_path": "/snap/zig/current/zig"
nektro commented 2 years ago

this is likely a bug for https://github.com/ziglang/vscode-zig not ZLS