From 7eae7812915602ece637714e6f82d4551e9697b6 Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Fri, 28 Sep 2018 11:42:50 -0700 Subject: Add elixir-ls language server support ElixirLS (https://github.com/JakeBecker/elixir-ls) is an LSP server for Elixir. It's distributed as a release package that can be downloaded from https://github.com/JakeBecker/elixir-ls/releases or built locally. The easiest way to start it is via Unix- and Win32-specific helper scripts, so that's the basis of this command integration. Alternatively, we could implement the contents of those platform-specific scripts in the linter's command callback in a language-neutral way, but there isn't any benefit to doing that aside from eliminating the platform check, and that could prove to be too tight of a coupling going forward. --- .../test_elixir_ls_command_callbacks.vader | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 test/command_callback/test_elixir_ls_command_callbacks.vader (limited to 'test') diff --git a/test/command_callback/test_elixir_ls_command_callbacks.vader b/test/command_callback/test_elixir_ls_command_callbacks.vader new file mode 100644 index 00000000..0d00354b --- /dev/null +++ b/test/command_callback/test_elixir_ls_command_callbacks.vader @@ -0,0 +1,29 @@ +Before: + call ale#assert#SetUpLinterTest('elixir', 'elixir_ls') + + let g:ale_has_override['win32'] = 0 + +After: + let g:ale_has_override = {} + + call ale#assert#TearDownLinterTest() + +Execute(should set correct defaults (unix)): + AssertLinter 'elixir-ls/language_server.sh', 'elixir-ls/language_server.sh' + +Execute(should set correct defaults (win32)): + let g:ale_has_override['win32'] = 1 + + AssertLinter 'elixir-ls\language_server.bat', 'elixir-ls\language_server.bat' + +Execute(should configure elixir-ls release location): + let b:ale_elixir_elixir_ls_release = 'boo' + + AssertLinter 'boo/language_server.sh', 'boo/language_server.sh' + +Execute(should set correct LSP values): + call ale#test#SetFilename('mix_paths/wrapped_project/lib/app.ex') + + AssertLSPLanguage 'elixir' + AssertLSPOptions {} + AssertLSPProject ale#path#Simplify(g:dir . '/mix_paths/wrapped_project') -- cgit v1.2.3