Zig NEWS

Discussion on: Setting up Visual Studio Code for writing Zig

dxps profile image
dxps

Yeah, found it and just did that.
Reloaded and restarted VSCode. Now, there seems to be some syntax highlighting (just on brackets), but no formatting on save.

Thread Thread
guidorice profile image
Alex G Rice

@dxps If you run the Format Document command in VSCode it should run zig fmt behind the scenes. Then you can toggle on the general VSCode preference: Editor: Format On Save.

Thread Thread
dxps profile image
dxps

Just found out that in the ZLS output ("output" vscode pane), whenever I do save it throws a "need to run as root or suid".
Gotta go to sleep, it's late here, i'll solve it tomorrow.

Thanks again for the help! Really appreciate it!

Thread Thread
guidorice profile image
Alex G Rice

Oh wow: i have never seen that error. Cheers I'm sure you'll get it sorted.

Thread Thread
dxps profile image
dxps

Issue solved.

I had to do chmod a+x {path/to}/zls
(instead of just chmod +x ...).