#VSCode extension not working
1 messages · Page 1 of 1 (latest)
you need to open a zig file first to trigger the extension activation :) (or perhaps the extension has brutally crashed)
yeah i have a zig file open :) syntax highlighing works but the lsp doesnt start
thats what happens when i try to run the lsp manually with ctrl+shift+p and "start/restart zig language server"
right; any errors in your vscode developer tools from the extension?
hmm no i dont see anything in the js console
hmm, again this is going to sound like a weird question, but did you actually open a .zig file and not like a new Untitled file with Zig content in it?
this just screams extension activation events haven't been tripped
https://github.com/ziglang/vscode-zig/blob/master/package.json#L19-L23 here they are for reference
yep its a zig file
ah i dont have a build.zig though currently, its a standalone file
does the extension/zls not work without a build script?
it should work fine with any zig code regardless of environment/setup
oh ok cool
this is an extension issue as far as i can tell though 🤔
could you try restarting vscode again and just double checking for errors in the dev tools, im totally stumped
if there's still nothing, opening an issue on https://github.com/ziglang/vscode-zig might be the best route :)
(btw you only have the Zig extension installed and not the deprecated ZLS one, correct?)
yeah i'm using the new zig extension
but nothing in the console after a restart unfortunately
ah 😔 well an issue is going to the best way to track this then
ah ok, thanks! ill open one now
thanks - sorry i couldn't figure this one out, maybe someone else will have more insight
cc @pine crescent; ever run into this? :)
just like you said, the vscode zig extension didn’t full initialize. I would also get this when if i ignore the message from vscode-zig about installing zls or using it from the path.
I would suggest to remove any zig related setting from settings.json, restart vscode, and wait for the "Zig path hasn't been set, do you want to specify the path or install Zig?" message to appear and select "Use Zig in PATH"
If you instead ignore that message it won't appear after restarting vscode and you will always get "command 'zig.zls.startRestart' not found". If I ran the "Zig Language Server: Install Server" command then the "Zig path hasn't been set" would open up again.
I had something like this happen today (on Mac), I quit vscode, opened it up again, saw when mac denied zls due to security issues, and overrode it in the mac preferences for privacy and security to allow zls. Also I downloaded a separate zls release and edited the extension settings to for the zig vscode extension to use this new release as the zls executable.
This issue could be related to https://github.com/ziglang/vscode-zig/commit/3c816960dc82138ecffd7e288107077996d6cbf7
hmm, i dont have any zig related settings in settings.json, and i never got that message