This repository has been archived on 2024-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
ale/ale_linters/yang/yang_lsp.vim

16 lines
530 B
VimL
Raw Normal View History

2018-08-03 19:59:32 +00:00
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')
2018-08-03 19:59:32 +00:00
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',
\})