diff options
author | Ben Falconer <ben@falconers.me.uk> | 2018-06-06 16:58:49 +0100 |
---|---|---|
committer | Ben Falconer <ben@falconers.me.uk> | 2018-06-06 17:53:36 +0100 |
commit | 1a4b08539bf44ef84516d26760093734e0257340 (patch) | |
tree | bd43a882f718b250e2219981692ecd126b55ddfe /test/test_linter_defintion_processing.vader | |
parent | c49ea1a5e336f9b9e31a8de362b42f33aa79eb95 (diff) | |
download | ale-1a4b08539bf44ef84516d26760093734e0257340.zip |
Allow initialization options to be passed to language servers
Diffstat (limited to 'test/test_linter_defintion_processing.vader')
-rw-r--r-- | test/test_linter_defintion_processing.vader | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/test_linter_defintion_processing.vader b/test/test_linter_defintion_processing.vader index 653587b6..48a4a394 100644 --- a/test/test_linter_defintion_processing.vader +++ b/test/test_linter_defintion_processing.vader @@ -465,3 +465,28 @@ Execute(PreProcess should complain about address_callback for non-LSP linters): AssertThrows call ale#linter#PreProcess(g:linter) AssertEqual '`address_callback` cannot be used when lsp != ''socket''', g:vader_exception + +Execute(PreProcess should complain about using initialization_options and initialization_options_callback together): + let g:linter = { + \ 'name': 'x', + \ 'lsp': 'socket', + \ 'address_callback': 'X', + \ 'language': 'x', + \ 'project_root_callback': 'x', + \ 'initialization_options': 'x', + \ 'initialization_options_callback': 'x', + \} + + AssertThrows call ale#linter#PreProcess(g:linter) + AssertEqual 'Only one of `initialization_options` or `initialization_options_callback` should be set', g:vader_exception + +Execute (PreProcess should throw when initialization_options_callback is not a callback): + AssertThrows call ale#linter#PreProcess({ + \ 'name': 'foo', + \ 'lsp': 'socket', + \ 'address_callback': 'X', + \ 'language': 'x', + \ 'project_root_callback': 'x', + \ 'initialization_options_callback': {}, + \}) + AssertEqual '`initialization_options_callback` must be a callback if defined', g:vader_exception |