Skip to content
This repository was archived by the owner on Feb 19, 2023. It is now read-only.

Commit 64cb590

Browse files
committed
Fix permission issue
1 parent f8021e4 commit 64cb590

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ instead of using `zls.json`!
3838

3939
> You can now install zls directly from the extension! Enjoy!
4040
41-
## 1.1.1
41+
## 1.1.1, 1.1.2
4242

4343
> Bug fixes, more streamlined installation

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ instead of using `zls.json`!
5252

5353
> You can now install zls directly from the extension! Enjoy!
5454
55-
### 1.1.1
55+
### 1.1.1, 1.1.2
5656

5757
> Bug fixes, more streamlined installation

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"type": "git",
1212
"url": "https://github.com/zigtools/zls-vscode"
1313
},
14-
"version": "1.1.1",
14+
"version": "1.1.2",
1515
"engines": {
1616
"vscode": "^1.68.0"
1717
},

src/extension.ts

+9-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
ServerOptions
88
} from "vscode-languageclient/node";
99
import axios from "axios";
10-
import { existsSync, writeFileSync } from "fs";
10+
import { chmodSync, existsSync, writeFileSync } from "fs";
1111
import * as mkdirp from "mkdirp";
1212

1313
let outputChannel: vscode.OutputChannel;
@@ -63,11 +63,15 @@ async function installExecutable(context: ExtensionContext): Promise<void> {
6363
if (!existsSync(installDir.fsPath))
6464
mkdirp.sync(installDir.fsPath);
6565

66+
const zlsBinPath = vscode.Uri.joinPath(installDir, `zls${def.endsWith("windows") ? ".exe" : ""}`).fsPath;
67+
6668
writeFileSync(vscode.Uri.joinPath(installDir, `build_runner.zig`).fsPath, buildRunner);
67-
writeFileSync(vscode.Uri.joinPath(installDir, `zls${def.endsWith("windows") ? ".exe" : ""}`).fsPath, exe, "binary");
69+
writeFileSync(zlsBinPath, exe, "binary");
70+
71+
chmodSync(zlsBinPath, 0o755);
6872

6973
let config = workspace.getConfiguration("zls");
70-
await config.update("path", vscode.Uri.joinPath(installDir, `zls${def.endsWith("windows") ? ".exe" : ""}`).fsPath, true);
74+
await config.update("path", zlsBinPath, true);
7175

7276
startClient(context);
7377
});
@@ -120,6 +124,8 @@ function startClient(context: ExtensionContext): Promise<void> {
120124
clientOptions
121125
);
122126

127+
outputChannel.appendLine(`Attempting to use zls @ ${zlsPath}`);
128+
123129
return new Promise<void>(resolve => {
124130
if (client)
125131
client.start().catch(err => {

0 commit comments

Comments
 (0)