diff --git a/TODO.md b/TODO.md index 1c1dacb..8c1ed0b 100644 --- a/TODO.md +++ b/TODO.md @@ -102,13 +102,15 @@ done, but these are the sort of enhancements I am thinking about. - [ ] fields - [ ] go to references of fields when tables are aliased - [ ] global search across other files -- [ ] Options / Configuration +- [X] Options / Configuration - [X] Configure over LSP - [X] Configure with some sort of per-project config file - [X] fennel/lua path - [X] lua version - [X] allowed global list - [X] enable/disable various linters + - [X] config validation + - [X] tests for config validation - [X] rename - [X] local symbols - [ ] module fields (may affect code behavior, may modify other files) diff --git a/src/fennel-ls/docs.fnl b/src/fennel-ls/docs.fnl index 3013a30..a7240d7 100644 --- a/src/fennel-ls/docs.fnl +++ b/src/fennel-ls/docs.fnl @@ -87,8 +87,6 @@ (or (. specials builtin-name) (. macros* builtin-name))) -;; TODO get-module-metadata - (λ validate-config [configuration invalid] (when (not (. lua-versions configuration.lua-version)) (invalid (.. "fennel-ls doesn't know about lua version " diff --git a/test/settings.fnl b/test/settings.fnl index 886a0ca..d40bfd7 100644 --- a/test/settings.fnl +++ b/test/settings.fnl @@ -63,7 +63,21 @@ (local _ nil)) nil) +(fn test-config-validation [] + (let [client (create-client {:main.fnl "" + :flsproject.fnl "{:lua-version \"lua5.0\"}"}) + [_init show] client.initialize-response] + (faith.= "window/showMessage" show.method) + (faith.match "doesn't know about lua version lua5.0" show.params.message)) + (let [client (create-client {:main.fnl "" + :flsproject.fnl "{:libraries {:nasilemak true}}"}) + [_init show] client.initialize-response] + (faith.= "window/showMessage" show.method) + (faith.match "Could not find docset for library nasilemak" + show.params.message))) + {: test-path : test-extra-globals : test-lints + : test-config-validation : test-editing-settings}