From: Brendan Hansen Date: Sat, 2 Dec 2023 15:02:45 +0000 (-0600) Subject: fixed: `onyx` binary not found in VSCode extension X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=a1acb27b603fcbc6856ae6dd3cd43b25a4e4321a;p=onyx.git fixed: `onyx` binary not found in VSCode extension --- diff --git a/build.bat b/build.bat index fd961f17..f97325bd 100644 --- a/build.bat +++ b/build.bat @@ -37,7 +37,7 @@ if "%1" == "dist" ( copy misc\onyx-windows.sublime-build dist\misc\onyx-windows.sublime-build copy misc\onyx-mode.el dist\misc\onyx-mode.el copy misc\onyx.sublime-syntax dist\misc\onyx.sublime-syntax - copy misc\vscode\onyx-0.1.8.vsix dist\misc\onyx-0.1.8.vsix + copy misc\vscode\onyxlang-0.1.9.vsix dist\misc\onyxlang-0.1.9.vsix copy onyx_runtime.dll dist\onyx_runtime.dll xcopy tests dist\tests /s /e /h /I diff --git a/build.sh b/build.sh index 0342ee01..871e42bb 100755 --- a/build.sh +++ b/build.sh @@ -61,7 +61,7 @@ package_all() { cp misc/onyx-windows.sublime-build "$DIST_DIR/misc" cp misc/onyx-mode.el "$DIST_DIR/misc" cp misc/onyx.sublime-syntax "$DIST_DIR/misc" - cp misc/vscode/onyx-0.1.8.vsix "$DIST_DIR/misc" + cp misc/vscode/onyxlang-0.1.9.vsix "$DIST_DIR/misc" cp LICENSE "$DIST_DIR/LICENSE" } diff --git a/misc/vscode/extension.ts b/misc/vscode/extension.ts index 7ca3a707..97f8a58b 100644 --- a/misc/vscode/extension.ts +++ b/misc/vscode/extension.ts @@ -27,9 +27,15 @@ export async function activate(context: vscode.ExtensionContext) { process.env["PATH"] = process.env["PATH"] + ":" + onyx_path + "/bin" } + let executable = `${onyx_path}/bin/onyx`; + if (process.platform == "win32") { + // Windows distributions are different + executable = `${onyx_path}/onyx`; + } + if (onyx_path) { let serverOptions: vslc.ServerOptions = { - command: `${onyx_path}/bin/onyx`, + command: executable, args: ["lsp"], transport: vslc.TransportKind.stdio, }; diff --git a/misc/vscode/onyxlang-0.1.9.vsix b/misc/vscode/onyxlang-0.1.9.vsix new file mode 100644 index 00000000..396c23dd Binary files /dev/null and b/misc/vscode/onyxlang-0.1.9.vsix differ diff --git a/misc/vscode/out/extension.js b/misc/vscode/out/extension.js index 264fa5c3..9c416e10 100644 --- a/misc/vscode/out/extension.js +++ b/misc/vscode/out/extension.js @@ -32,9 +32,14 @@ function activate(context) { process.env["ONYX_PATH"] = onyx_path; process.env["PATH"] = process.env["PATH"] + ":" + onyx_path + "/bin"; } + let executable = `${onyx_path}/bin/onyx`; + if (process.platform == "win32") { + // Windows distributions are different + executable = `${onyx_path}/onyx`; + } if (onyx_path) { let serverOptions = { - command: `${onyx_path}/bin/onyx`, + command: executable, args: ["lsp"], transport: vslc.TransportKind.stdio, }; diff --git a/misc/vscode/package.json b/misc/vscode/package.json index a7511f14..a57961a6 100644 --- a/misc/vscode/package.json +++ b/misc/vscode/package.json @@ -2,7 +2,7 @@ "name": "onyxlang", "displayName": "Onyx Programming Language", "description": "Onyx syntax highlighting and debugger support.", - "version": "0.1.8", + "version": "0.1.9", "publisher": "onyxlang", "license": "BSD-2-Clause", "engines": {