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

Unable to install ZLS 0.11.0 for Zig version 0.11.0 #170

Open
ftruter opened this issue Jan 19, 2024 · 1 comment
Open

Unable to install ZLS 0.11.0 for Zig version 0.11.0 #170

ftruter opened this issue Jan 19, 2024 · 1 comment

Comments

@ftruter
Copy link

ftruter commented Jan 19, 2024

Can someone please tell me how to install ZLS manually? Doing it through this extension always fails.

It downloads the ZIG tarball and installs it. Then it downloads the ZLS tarball and upon installing it:-

TypeError: Cannot read properties of undefined (reading 'status')
Source: Zig Language

macOS Sonoma
System installed Python 3.11.6

Version: 1.86.0-insider
Commit: 271fb7fbd599b49a1482ea7284a50b3229317f96
Date: 2024-01-19T05:46:59.001Z
Electron: 27.2.1
ElectronBuildId: 26149897
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Darwin arm64 23.3.0

@Vexu
Copy link
Member

Vexu commented Jan 20, 2024

That's strange, would you be able to install a modified version of the extension to get a more accurate error message?

Steps:

git clone https://github.com/ziglang/vscode-zig.git --depth 1 --single-branch
git apply patch
npm install
npx vsce package
code --install-extension vscode-zig-0.5.1.vsix

patch:

diff --git a/src/zls.ts b/src/zls.ts
index b6fe42d..5a77334 100644
--- a/src/zls.ts
+++ b/src/zls.ts
@@ -216,7 +216,7 @@ async function installVersion(context: ExtensionContext, version: SemVer) {
             })).data;
         } catch (err) {
             // Missing prebuilt binary is reported as AccessDenied
-            if (err.response.status == 403) {
+            if (err.response != undefined && err.response.status == 403) {
                 window.showErrorMessage(`A prebuilt ZLS ${version} binary is not available for your system. You can build it yourself with https://github.com/zigtools/zls#from-source`);
                 return;
             }

And if not, you can manually install ZLS by downloading https://zigtools-releases.nyc3.digitaloceanspaces.com/zls/0.11.0/aarch64-macos/zls, making it executable with chmod and setting zig.zls.path to 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

No branches or pull requests

2 participants