Documented initializationOptions

We accept the settings object either from initialize:initializationOptions or
workspace/didChangeConfiguration:settings. The readme now explains this.
This commit is contained in:
XeroOl 2023-08-26 22:31:40 -05:00
parent 31ea7a1039
commit 9db2ec7537
2 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,5 @@
# fennel-ls # fennel-ls
A language server for fennel-ls. A language server for fennel.
Supports Go-to-definition, and a little bit of completion suggestions. Supports Go-to-definition, and a little bit of completion suggestions.
Fennel-LS uses static analysis, and does not execute your code. 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 ## License
fennel-ls is licensed under the MIT license. See LICENSE for more info. fennel-ls is licensed under the MIT license. See LICENSE for more info.
This project also contains files from other projects: This project also contains files from other projects:

View File

@ -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)) (state.flush-uri self uri))
(λ notifications.workspace/didChangeConfiguration [self send {: settings}] (λ notifications.workspace/didChangeConfiguration [self send {: settings}]
(state.write-configuration self settings.fennel-ls)) (state.write-configuration self (?. settings :fennel-ls)))
(λ requests.shutdown [self send] (λ 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" "The server still needs to respond to this request, so the program can't close yet. Just wait until notifications.exit"