changed lsp install instructions
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Sat, 25 Nov 2023 16:14:58 +0000 (10:14 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Sat, 25 Nov 2023 16:14:58 +0000 (10:14 -0600)
onyx-pkg.kdl
src/app.onyx
www/templates/pages/docs/env_setup.html

index 8ce7dd4bdf7ba2bf86417c1589ff9261f9cede04..c15c6fd8a775fb4dfc988f02f0791d5fdb6fe5c7 100644 (file)
@@ -12,7 +12,21 @@ config {
 }
 
 dependencies {
-    http-server "0.2.24" git="git://onyxlang.io/repo/http-server" 
-    otmp "0.0.26" git="git://onyxlang.io/repo/otmp" 
+    http-server "0.2.24" git="git://repo.onyxlang.io/repo/http-server" 
+    otmp "0.0.26" git="git://repo.onyxlang.io/repo/otmp" 
+}
+
+build {
+    default {
+        target "out.wasm" 
+        runtime "onyx" 
+        source "build.onyx" 
+    }
+    wasmer {
+        target "wasmer.wasm" 
+        runtime "wasi" 
+        source "build.onyx" 
+        define "WASIX" "CGI_MODE" 
+    }
 }
 
index 15712ce2250f3622b35805cb0a13013b160401fa..91809888851d4bcf52b05b960034e96e0020297a 100644 (file)
@@ -8,7 +8,7 @@ use core.encoding.json
 #inject runtime.vars {
     Enable_Heap_Debug :: true
     // Debug :: true
-    CGI_MODE :: true
+    // CGI_MODE :: true
 }
 
 reg: otmp.TemplateRegistry;
@@ -98,6 +98,8 @@ news_articles: Cached_Resource([] Article);
 }
 
 main :: () {
+    default_log_level(.Error);
+    
     reg = otmp.registry();
     reg->load_directory("./www/templates", ".html");
 
@@ -148,13 +150,14 @@ main :: () {
         }
     });
 
-    logger := http.server.logger(style=.V2);
-    pipes->pipe(&logger);
 
     #if #defined(runtime.vars.CGI_MODE) {
         http.server.cgi(pipes);
 
     } else {
+        logger := http.server.logger(style=.V2);
+        pipes->pipe(&logger);
+
         app := http.server.tcp(pipes, .{ thread_count = 8 });
 
         port := conv.parse_int(os.env("SERVER_PORT") ?? "8000");
index f6bf213b531cede4edb483ee6df6247c392c9e0b..b8221f523a5c4222d7bcf13272498efbfd267c77 100644 (file)
     <p>On Linux, MacOS, or the Windows Subsystem for Linux, run the following commands.</p>
     <pre class="hljs"><code class="language-sh"># Clone the Onyx Language Server
 git clone https://github.com/onyx-lang/onyx-lsp
-cd onyx-lsp/run_tree
+cd onyx-lsp
 # Make the install script executable
-chmod +x ./install
-# Install the LSP
-./install</code></pre>
+chmod +x ./install.sh
+# Install the LSP (compiles and places the WASM file into $ONYX_PATH/tools)
+./install.sh</code></pre>
 
     <h3>Visual Studio Code</h3>
     <p>Installing the extension automatically enables the language server in VS Code.</p>