diff options
author | David Hotham <david.hotham@metaswitch.com> | 2018-08-03 20:59:32 +0100 |
---|---|---|
committer | David Hotham <david.hotham@metaswitch.com> | 2018-08-03 21:13:48 +0100 |
commit | d0e33022539863b2c55aca49c1d1a9852b50c91d (patch) | |
tree | c79ff6e07c19b9eec0b261e73debeb89a0b836cd /ale_linters | |
parent | 209cd547839c78403a2453d6a1e454d121103e28 (diff) | |
download | ale-d0e33022539863b2c55aca49c1d1a9852b50c91d.zip |
Add support for yang-lsp
Diffstat (limited to 'ale_linters')
-rw-r--r-- | ale_linters/yang/yang_lsp.vim | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ale_linters/yang/yang_lsp.vim b/ale_linters/yang/yang_lsp.vim new file mode 100644 index 00000000..a60e9113 --- /dev/null +++ b/ale_linters/yang/yang_lsp.vim @@ -0,0 +1,14 @@ +call ale#Set('yang_lsp_executable', 'yang-language-server') + +function! ale_linters#yang#yang_lsp#GetProjectRoot(buffer) abort + let l:project_root = ale#path#FindNearestFile(a:buffer, 'yang.settings') + return !empty(l:project_root) ? fnamemodify(l:project_root, ':h') : '' +endfunction + +call ale#linter#Define('yang', { +\ 'name': 'yang_lsp', +\ 'lsp': 'stdio', +\ 'executable_callback': ale#VarFunc('yang_lsp_executable'), +\ 'project_root_callback': 'ale_linters#yang#yang_lsp#GetProjectRoot', +\ 'command': '%e', +\}) |