Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 0.5.9 failing to register commands #231

Closed
michaelbartnett opened this issue Sep 15, 2024 · 0 comments · Fixed by #233
Closed

Version 0.5.9 failing to register commands #231

michaelbartnett opened this issue Sep 15, 2024 · 0 comments · Fixed by #233

Comments

@michaelbartnett
Copy link

michaelbartnett commented Sep 15, 2024

I updated zig, zls, and vscode-zig recently. The most recent version of vscode-zig seems to fail to register commands on my pc (win11 in case that matters). Rolling back to 0.5.8 fixes the issue.

I run "Zig Language Server: Start/Restart Server" and I get a message box reporting failure:

[Window Title]
Visual Studio Code

[Main Instruction]
Command 'Zig Language Server: Start / Restart Server' resulted in an error

[Content]
command 'zig.zls.startRestart' not found

[OK]

I'm not terribly familiar with vscode extension dev, but I found how to view the extension host log, so here's that:

2024-09-15 11:57:38.696 [info] Extension host with pid 7352 started
2024-09-15 11:57:38.696 [info] Skipping acquiring lock for c:\Users\micha\AppData\Roaming\Code\User\workspaceStorage\fba326b3c1d4a04363998a16351e4549.
2024-09-15 11:57:38.901 [info] ExtensionService#_doActivateExtension vscode.emmet, startup: false, activationEvent: 'onLanguage'
2024-09-15 11:57:38.909 [info] ExtensionService#_doActivateExtension ziglang.vscode-zig, startup: false, activationEvent: 'onLanguage:zig'
2024-09-15 11:57:38.972 [warning] DiagnosticCollection with name 'zig' does already exist.
2024-09-15 11:57:38.976 [error] Activating extension ziglang.vscode-zig failed due to an error:
2024-09-15 11:57:38.976 [error] Error: spawn EINVAL
	at ChildProcess.spawn (node:internal/child_process:421:11)
	at spawn (node:child_process:800:9)
	at Object.execFile (node:child_process:352:17)
	at t.<computed> [as execFile] (node:electron/js2c/node_init:2:2610)
	at CC (c:\Users\micha\.vscode\extensions\ziglang.vscode-zig-0.5.9\out\extension.js:50:22549)
	at wC (c:\Users\micha\.vscode\extensions\ziglang.vscode-zig-0.5.9\out\extension.js:50:21929)
	at c:\Users\micha\.vscode\extensions\ziglang.vscode-zig-0.5.9\out\extension.js:50:27692
	at <anonymous>
	at async YF (c:\Users\micha\.vscode\extensions\ziglang.vscode-zig-0.5.9\out\extension.js:50:27611)
	at async m.n (c:\Users\micha\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:151:6409)
	at async m (c:\Users\micha\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:151:6372)
	at async m.l (c:\Users\micha\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:151:5829)

Here are my vsocde user settings:

{
    "zig.path": "zig",
    "zig.initialSetupDone": true,
    "zig.zls.highlightGlobalVarDeclarations": true,
    "zig.zls.inlayHintsHideRedundantParamNames": true,
    "zig.zls.inlayHintsHideRedundantParamNamesLastToken": true,
    "editor.fontSize": 12,
    "window.menuBarVisibility": "compact",
    "workbench.layoutControl.enabled": false,
    "window.commandCenter": false,
    "editor.renderWhitespace": "all",
    "zig.zls.enableAutofix": true,
    "terminal.integrated.env.windows": {},
    "zig.zls.additionalOptions": {},
    "zig.zls.warnStyle": true,
}

And my workspace settings:

{
    "zig.formattingProvider": "extension",
    "zig.path": "${workspaceFolder}\\tools\\zig.cmd",
    "zig.zls.buildOnSaveStep": "check",
    "zig.zls.path": "${workspaceFolder}\\tools\\zls.exe",
    "files.exclude": {
        "**/.git": true,
        "**/zig-cache": true,
        "**/Thumbs.db": true,
        "**/.DS_Store": true,
        "tools/zig.cmd": true,
        "tools/zig-windows-x86_64-*": true
    },
    "zig.zls.enableBuildOnSave": true
}

I download zig and zls to a "tools" folder in the workspace so I can still zigup master my system zig install to try out new zig versions without breaking this project.

[EDIT] I did confirm earlier that setting the paths to use absolute paths instead of vscode substitutions didn't fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant