Add support for yang-lsp

This commit is contained in:
David Hotham
2018-08-03 20:59:32 +01:00
parent 209cd54783
commit d0e3302253
5 changed files with 47 additions and 0 deletions
+14
View File
@@ -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',
\})