install.fairie/dotfiles/.vim/plugged/ale/ale_linters/yang/yang_lsp.vim
Git E2E Dev Test Username e149692cc9 git subrepo clone https://github.com/dense-analysis/ale.git ./dotfiles/.vim/plugged/ale
subrepo:
  subdir:   "dotfiles/.vim/plugged/ale"
  merged:   "e4b205440"
upstream:
  origin:   "https://github.com/dense-analysis/ale.git"
  branch:   "master"
  commit:   "e4b205440"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"
2022-10-18 10:37:09 -04:00

15 lines
528 B
VimL

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': {b -> ale#Var(b, 'yang_lsp_executable')},
\ 'project_root': function('ale_linters#yang#yang_lsp#GetProjectRoot'),
\ 'command': '%e',
\})