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

Commit

Permalink
Fix permission issue
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperAuguste committed Jul 14, 2022
1 parent f8021e4 commit 64cb590
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ instead of using `zls.json`!

> You can now install zls directly from the extension! Enjoy!
## 1.1.1
## 1.1.1, 1.1.2

> Bug fixes, more streamlined installation
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ instead of using `zls.json`!

> You can now install zls directly from the extension! Enjoy!
### 1.1.1
### 1.1.1, 1.1.2

> Bug fixes, more streamlined installation
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"type": "git",
"url": "https://github.com/zigtools/zls-vscode"
},
"version": "1.1.1",
"version": "1.1.2",
"engines": {
"vscode": "^1.68.0"
},
Expand Down
12 changes: 9 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
ServerOptions
} from "vscode-languageclient/node";
import axios from "axios";
import { existsSync, writeFileSync } from "fs";
import { chmodSync, existsSync, writeFileSync } from "fs";
import * as mkdirp from "mkdirp";

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

const zlsBinPath = vscode.Uri.joinPath(installDir, `zls${def.endsWith("windows") ? ".exe" : ""}`).fsPath;

writeFileSync(vscode.Uri.joinPath(installDir, `build_runner.zig`).fsPath, buildRunner);
writeFileSync(vscode.Uri.joinPath(installDir, `zls${def.endsWith("windows") ? ".exe" : ""}`).fsPath, exe, "binary");
writeFileSync(zlsBinPath, exe, "binary");

chmodSync(zlsBinPath, 0o755);

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

startClient(context);
});
Expand Down Expand Up @@ -120,6 +124,8 @@ function startClient(context: ExtensionContext): Promise<void> {
clientOptions
);

outputChannel.appendLine(`Attempting to use zls @ ${zlsPath}`);

return new Promise<void>(resolve => {
if (client)
client.start().catch(err => {
Expand Down

0 comments on commit 64cb590

Please sign in to comment.