diff options
Diffstat (limited to 'ale_linters/elm')
-rw-r--r-- | ale_linters/elm/ls.vim (renamed from ale_linters/elm/elm_ls.vim) | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ale_linters/elm/elm_ls.vim b/ale_linters/elm/ls.vim index a02dbf42..38a5b234 100644 --- a/ale_linters/elm/elm_ls.vim +++ b/ale_linters/elm/ls.vim @@ -10,13 +10,13 @@ call ale#Set('elm_ls_elm_format_path', '') call ale#Set('elm_ls_elm_test_path', '') call ale#Set('elm_ls_elm_analyse_trigger', 'change') -function! elm_ls#GetRootDir(buffer) abort +function! ale_linters#elm#ls#GetProjectRoot(buffer) abort let l:elm_json = ale#path#FindNearestFile(a:buffer, 'elm.json') return !empty(l:elm_json) ? fnamemodify(l:elm_json, ':p:h') : '' endfunction -function! elm_ls#GetOptions(buffer) abort +function! ale_linters#elm#ls#GetOptions(buffer) abort return { \ 'elmPath': ale#Var(a:buffer, 'elm_ls_elm_path'), \ 'elmFormatPath': ale#Var(a:buffer, 'elm_ls_elm_format_path'), @@ -26,7 +26,8 @@ function! elm_ls#GetOptions(buffer) abort endfunction call ale#linter#Define('elm', { -\ 'name': 'elm_ls', +\ 'name': 'ls', +\ 'aliases': ['elm_ls'], \ 'lsp': 'stdio', \ 'executable': {b -> ale#path#FindExecutable(b, 'elm_ls', [ \ 'node_modules/.bin/elm-language-server', @@ -34,7 +35,7 @@ call ale#linter#Define('elm', { \ 'elm-lsp' \ ])}, \ 'command': '%e --stdio', -\ 'project_root': function('elm_ls#GetRootDir'), +\ 'project_root': function('ale_linters#elm#ls#GetProjectRoot'), \ 'language': 'elm', \ 'initialization_options': function('elm_ls#GetOptions') \}) |