fixed: `onyx` binary not found in VSCode extension
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Sat, 2 Dec 2023 15:02:45 +0000 (09:02 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Sat, 2 Dec 2023 15:02:45 +0000 (09:02 -0600)
build.bat
build.sh
misc/vscode/extension.ts
misc/vscode/onyxlang-0.1.9.vsix [new file with mode: 0644]
misc/vscode/out/extension.js
misc/vscode/package.json

index fd961f17ae43f5173f6e730b2eb3fa18c39edd12..f97325bdc632156c8cb80e1307ddd0b58e33bd54 100644 (file)
--- 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
index 0342ee01c0339d7eb8c1604d62d013a7ede1baa3..871e42bb5eb30d9ff878879111e03fe85b9ce994 100755 (executable)
--- 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"
 }
index 7ca3a7075d6b003cab79aee22fb945db0f2059c0..97f8a58b6e82fdc5ab346ab9bc36be3fab4a2f63 100644 (file)
@@ -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 (file)
index 0000000..396c23d
Binary files /dev/null and b/misc/vscode/onyxlang-0.1.9.vsix differ
index 264fa5c3ea87f8709d5580a92203b245a618a246..9c416e1098ac0ce01743c6ff75b6a22a18cb1040 100644 (file)
@@ -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,
             };
index a7511f1491c27165399a3b51b4e33e2293e028d6..a57961a6991f3aed75e65a6b7842c3b987b8678a 100644 (file)
@@ -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": {