Skip to content

Commit

Permalink
resolve zig exe path when performing workspace build
Browse files Browse the repository at this point in the history
  • Loading branch information
Techatrix committed Feb 14, 2024
1 parent fc605fa commit 77b7690
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/zigCompilerProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ export default class ZigCompilerProvider implements vscode.CodeActionProvider {
private _doCompile(textDocument: vscode.TextDocument) {
const config = vscode.workspace.getConfiguration("zig");

const zigPath = getZigPath();

const buildOption = config.get<string>("buildOption");
const processArg: string[] = [buildOption];
let workspaceFolder = vscode.workspace.getWorkspaceFolder(textDocument.uri);
Expand Down Expand Up @@ -151,7 +153,7 @@ export default class ZigCompilerProvider implements vscode.CodeActionProvider {
});

let decoded = "";
const childProcess = cp.spawn("zig", processArg, { cwd });
const childProcess = cp.spawn(zigPath, processArg, { cwd });
if (childProcess.pid) {
childProcess.stderr.on("data", (data: Buffer) => {
decoded += data;
Expand Down

0 comments on commit 77b7690

Please sign in to comment.