1
0
Fork 0
mirror of synced 2024-11-26 18:55:34 -05:00
ultimate-vim/sources_non_forked/ale/ale_linters/hack/hack.vim

23 lines
720 B
VimL
Raw Normal View History

2018-08-25 12:13:42 -04:00
" Author: Fred Emmott <fe@fb.com>
" Description: Hack support via `hack lsp`
call ale#Set('hack_hack_executable', 'hh_client')
function! ale_linters#hack#hack#GetProjectRoot(buffer) abort
let l:hhconfig = ale#path#FindNearestFile(a:buffer, '.hhconfig')
return !empty(l:hhconfig) ? fnamemodify(l:hhconfig, ':h') : ''
endfunction
function! ale_linters#hack#hack#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'hack_hack_executable')
endfunction
call ale#linter#Define('hack', {
\ 'name': 'hack',
\ 'lsp': 'stdio',
2019-03-08 06:04:56 -05:00
\ 'executable': function('ale_linters#hack#hack#GetExecutable'),
2018-08-25 12:13:42 -04:00
\ 'command': '%e lsp --from vim-ale',
2019-03-08 06:04:56 -05:00
\ 'project_root': function('ale_linters#hack#hack#GetProjectRoot'),
2018-08-25 12:13:42 -04:00
\})