summaryrefslogtreecommitdiff
path: root/ale_linters/elixir/elixir_ls.vim
blob: a7d7110c83d6cfc308d9af4c133158302aa1a8d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
" Author: Jon Parise <jon@indelible.org>
" Description: ElixirLS integration (https://github.com/elixir-lsp/elixir-ls)

call ale#Set('elixir_elixir_ls_release', 'elixir-ls')
call ale#Set('elixir_elixir_ls_config', {})

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 = 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': function('ale_linters#elixir#elixir_ls#GetExecutable'),
\   'command': function('ale_linters#elixir#elixir_ls#GetExecutable'),
\   'project_root': function('ale#handlers#elixir#FindMixUmbrellaRoot'),
\   'lsp_config': {b -> ale#Var(b, 'elixir_elixir_ls_config')},
\})