diff options
author | w0rp <w0rp@users.noreply.github.com> | 2019-03-25 21:41:33 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-25 21:41:33 +0000 |
commit | 8768a309b8ef1c2e819dcb6f4630f73acab59792 (patch) | |
tree | 81161ed835dde269fb94df88ceb7fa40b0f775a2 /ale_linters/elm/elm_lsp.vim | |
parent | ad998211f892cdbfac6df3ab296a4d1b849f4086 (diff) | |
parent | 8ec96154000031e59d96092efe1ee9fd104ffcd0 (diff) | |
download | ale-8768a309b8ef1c2e819dcb6f4630f73acab59792.zip |
Merge pull request #2378 from antew/feature/elm-lsp-linter
Elm: Support for elm-lsp
Diffstat (limited to 'ale_linters/elm/elm_lsp.vim')
-rw-r--r-- | ale_linters/elm/elm_lsp.vim | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ale_linters/elm/elm_lsp.vim b/ale_linters/elm/elm_lsp.vim new file mode 100644 index 00000000..2259286f --- /dev/null +++ b/ale_linters/elm/elm_lsp.vim @@ -0,0 +1,22 @@ +" Author: antew - https://github.com/antew +" Description: LSP integration for elm, currently supports diagnostics (linting) + +call ale#Set('elm_lsp_executable', 'elm-lsp') +call ale#Set('elm_lsp_use_global', get(g:, 'ale_use_global_executables', 0)) + +function! elm_lsp#GetRootDir(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 + +call ale#linter#Define('elm', { +\ 'name': 'elm_lsp', +\ 'lsp': 'stdio', +\ 'executable': {b -> ale#node#FindExecutable(b, 'elm_lsp', [ +\ 'node_modules/.bin/elm-lsp', +\ ])}, +\ 'command': '%e --stdio', +\ 'project_root': function('elm_lsp#GetRootDir'), +\ 'language': 'elm' +\}) |