vscode-zig
vscode-zig copied to clipboard
Command 'Format Document With...' resulted in an error
Trying to run format document with throws this error:
Works on my machine, can you provide more info?
code --version outputs:
1.79.2
695af097c7bd098fbf017ce3ac85e09bbc5dda06
arm64
zig version is 0.10.1
which zig is /opt/homebrew/bin/zig
My vscode settings is
{
"workbench.colorTheme": "Default Dark Modern",
"zig.zls.path": "/Users/benjamindaniel/Library/Application Support/Code/User/globalStorage/ziglang.vscode-zig/zls_install/zls",
"editor.accessibilitySupport": "off",
"editor.inlineSuggest.enabled": true,
"redhat.telemetry.enabled": true
}
I only get this error when I run format document with... command with zig
which zigis/opt/homebrew/bin/zig
Hmm, is that a symlink? This might be a duplicate of #34.
I used homebrew to install zig.
Does homebrew install symlinks? If yes running file /opt/homebrew/bin/zig should give a path to the link target, can you try setting that as zigPath and seeing if formatting works then?
Running file /opt/homebrew/bin/zig gives /opt/homebrew/bin/zig: Mach-O 64-bit executable arm64 so I don't think it did install symlinks.
And just to make sure, your zig.zigPath is set to that path? And plain format document (no with) works?
Observing the same behavior:
- downloaded zig (0.11.0-dev.3704+729a051e9)
- added zig to PATH
- point
zig.zigPathto the zig binary
Format Document With... throws the Cannot read properties of undefined error.
Format Document doesn't seem to be doing anything.
Are you also on macos?
Trying to download zig with vscode throws the error:
vscode also displays the warning:
The first issue was fixed in https://github.com/ziglang/vscode-zig/commit/1b6dfd19550eed115117ee7c2fb6c4625db54fca and the second is tracked in #86.
@Vexu I'm on macos, yes.
@Vexu yes I am on macOS, M1.