summaryrefslogtreecommitdiff
path: root/ale_linters/elixir
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2018-10-11 21:43:58 +0100
committerGitHub <noreply@github.com>2018-10-11 21:43:58 +0100
commite5b5ce9f512d4a36e944f728f4d1ff5d8238c64f (patch)
tree66982c439b1f386dc691be877f25547cea209fa8 /ale_linters/elixir
parent87986520d62c497fbbde94e2e6bed35f5489cfcd (diff)
parent7eae7812915602ece637714e6f82d4551e9697b6 (diff)
downloadale-e5b5ce9f512d4a36e944f728f4d1ff5d8238c64f.zip
Merge pull request #1956 from jparise/elixir-ls
Add elixir-ls language server support
Diffstat (limited to 'ale_linters/elixir')
-rw-r--r--ale_linters/elixir/elixir_ls.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/ale_linters/elixir/elixir_ls.vim b/ale_linters/elixir/elixir_ls.vim
new file mode 100644
index 00000000..d5ad7cfc
--- /dev/null
+++ b/ale_linters/elixir/elixir_ls.vim
@@ -0,0 +1,19 @@
+" Author: Jon Parise <jon@indelible.org>
+" Description: elixir-ls integration (https://github.com/JakeBecker/elixir-ls)
+
+call ale#Set('elixir_elixir_ls_release', 'elixir-ls')
+
+function! ale_linters#elixir#elixir_ls#GetExecutable(buffer) abort
+ let l:dir = ale#path#Simplify(ale#Var(a:buffer, 'elixir_elixir_ls_release'))
+ let l:cmd = ale#Has('win32') ? '\language_server.bat' : '/language_server.sh'
+
+ return l:dir . l:cmd
+endfunction
+
+call ale#linter#Define('elixir', {
+\ 'name': 'elixir-ls',
+\ 'lsp': 'stdio',
+\ 'executable_callback': 'ale_linters#elixir#elixir_ls#GetExecutable',
+\ 'command_callback': 'ale_linters#elixir#elixir_ls#GetExecutable',
+\ 'project_root_callback': 'ale#handlers#elixir#FindMixProjectRoot',
+\})