#VSCode extension not working

1 messages · Page 1 of 1 (latest)

candid warren
#

I've never had an issue with the vscode extension but its not working on a new installation. I have zig/zls executables in path, but getting this whenever I try to start the language server. Any idea why?

ancient sandal
#

you need to open a zig file first to trigger the extension activation :) (or perhaps the extension has brutally crashed)

candid warren
#

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"

ancient sandal
#

right; any errors in your vscode developer tools from the extension?

candid warren
#

hmm no i dont see anything in the js console

ancient sandal
#

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

candid warren
#

ah i dont have a build.zig though currently, its a standalone file

#

does the extension/zls not work without a build script?

ancient sandal
#

it should work fine with any zig code regardless of environment/setup

candid warren
#

oh ok cool

ancient sandal
#

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

#

(btw you only have the Zig extension installed and not the deprecated ZLS one, correct?)

candid warren
#

yeah i'm using the new zig extension

#

but nothing in the console after a restart unfortunately

ancient sandal
#

ah 😔 well an issue is going to the best way to track this then

candid warren
#

ah ok, thanks! ill open one now

ancient sandal
#

thanks - sorry i couldn't figure this one out, maybe someone else will have more insight

#

cc @pine crescent; ever run into this? :)

pine crescent
#

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.

lofty nymph
#

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.

candid warren