From 645de7ba716fc923919b6ced5a1bc67c76f43f40 Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Sat, 25 Nov 2023 10:14:58 -0600 Subject: [PATCH] changed lsp install instructions --- onyx-pkg.kdl | 18 ++++++++++++++++-- src/app.onyx | 9 ++++++--- www/templates/pages/docs/env_setup.html | 8 ++++---- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/onyx-pkg.kdl b/onyx-pkg.kdl index 8ce7dd4..c15c6fd 100644 --- a/onyx-pkg.kdl +++ b/onyx-pkg.kdl @@ -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" + } } diff --git a/src/app.onyx b/src/app.onyx index 15712ce..9180988 100644 --- a/src/app.onyx +++ b/src/app.onyx @@ -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"); diff --git a/www/templates/pages/docs/env_setup.html b/www/templates/pages/docs/env_setup.html index f6bf213..b8221f5 100644 --- a/www/templates/pages/docs/env_setup.html +++ b/www/templates/pages/docs/env_setup.html @@ -106,11 +106,11 @@

On Linux, MacOS, or the Windows Subsystem for Linux, run the following commands.

# 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
+chmod +x ./install.sh +# Install the LSP (compiles and places the WASM file into $ONYX_PATH/tools) +./install.sh

Visual Studio Code

Installing the extension automatically enables the language server in VS Code.

-- 2.25.1