From 9db2ec7537c3c99ec7eb478444cc14242d5e25c6 Mon Sep 17 00:00:00 2001 From: XeroOl Date: Sat, 26 Aug 2023 22:31:40 -0500 Subject: [PATCH] Documented initializationOptions We accept the settings object either from initialize:initializationOptions or workspace/didChangeConfiguration:settings. The readme now explains this. --- README.md | 6 +++++- src/fennel-ls/handlers.fnl | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 78085a6..2e7cf9b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # fennel-ls -A language server for fennel-ls. +A language server for fennel. Supports Go-to-definition, and a little bit of completion suggestions. Fennel-LS uses static analysis, and does not execute your code. @@ -57,6 +57,10 @@ fennel-ls default settings: } ``` +Your editor can send these settings using one of these two methods: +* The client sends an `initialize` request with the structure `{initializationOptions: {"fennel-ls": {...}}, ...}` +* The client sends a `workspace/didChangeConfiguration` notfication containing the field `{settings: {"fennel-ls": {YOUR_SETTINGS}}}` + ## License fennel-ls is licensed under the MIT license. See LICENSE for more info. This project also contains files from other projects: diff --git a/src/fennel-ls/handlers.fnl b/src/fennel-ls/handlers.fnl index f463d4e..5a56e0d 100644 --- a/src/fennel-ls/handlers.fnl +++ b/src/fennel-ls/handlers.fnl @@ -221,7 +221,7 @@ Every time the client sends a message, it gets handled by a function in the corr (state.flush-uri self uri)) (λ notifications.workspace/didChangeConfiguration [self send {: settings}] - (state.write-configuration self settings.fennel-ls)) + (state.write-configuration self (?. settings :fennel-ls))) (λ requests.shutdown [self send] "The server still needs to respond to this request, so the program can't close yet. Just wait until notifications.exit"