Add test for config validation.
This commit is contained in:
parent
670f7d108b
commit
024083c7d2
4
TODO.md
4
TODO.md
@ -102,13 +102,15 @@ done, but these are the sort of enhancements I am thinking about.
|
|||||||
- [ ] fields
|
- [ ] fields
|
||||||
- [ ] go to references of fields when tables are aliased
|
- [ ] go to references of fields when tables are aliased
|
||||||
- [ ] global search across other files
|
- [ ] global search across other files
|
||||||
- [ ] Options / Configuration
|
- [X] Options / Configuration
|
||||||
- [X] Configure over LSP
|
- [X] Configure over LSP
|
||||||
- [X] Configure with some sort of per-project config file
|
- [X] Configure with some sort of per-project config file
|
||||||
- [X] fennel/lua path
|
- [X] fennel/lua path
|
||||||
- [X] lua version
|
- [X] lua version
|
||||||
- [X] allowed global list
|
- [X] allowed global list
|
||||||
- [X] enable/disable various linters
|
- [X] enable/disable various linters
|
||||||
|
- [X] config validation
|
||||||
|
- [X] tests for config validation
|
||||||
- [X] rename
|
- [X] rename
|
||||||
- [X] local symbols
|
- [X] local symbols
|
||||||
- [ ] module fields (may affect code behavior, may modify other files)
|
- [ ] module fields (may affect code behavior, may modify other files)
|
||||||
|
|||||||
@ -87,8 +87,6 @@
|
|||||||
(or (. specials builtin-name)
|
(or (. specials builtin-name)
|
||||||
(. macros* builtin-name)))
|
(. macros* builtin-name)))
|
||||||
|
|
||||||
;; TODO get-module-metadata
|
|
||||||
|
|
||||||
(λ validate-config [configuration invalid]
|
(λ validate-config [configuration invalid]
|
||||||
(when (not (. lua-versions configuration.lua-version))
|
(when (not (. lua-versions configuration.lua-version))
|
||||||
(invalid (.. "fennel-ls doesn't know about lua version "
|
(invalid (.. "fennel-ls doesn't know about lua version "
|
||||||
|
|||||||
@ -63,7 +63,21 @@
|
|||||||
(local _ nil))
|
(local _ nil))
|
||||||
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-path
|
||||||
: test-extra-globals
|
: test-extra-globals
|
||||||
: test-lints
|
: test-lints
|
||||||
|
: test-config-validation
|
||||||
: test-editing-settings}
|
: test-editing-settings}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user