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/hack/hack.vim

23 lines
718 B
VimL
Raw Normal View History

" Author: Fred Emmott <fe@fb.com>
" Description: Hack support via `hack lsp`
2018-08-02 19:59:04 +00:00
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')
2018-08-02 18:44:17 +00:00
return !empty(l:hhconfig) ? fnamemodify(l:hhconfig, ':h') : ''
endfunction
function! ale_linters#hack#hack#GetExecutable(buffer) abort
2018-08-02 19:59:04 +00:00
return ale#Var(a:buffer, 'hack_hack_executable')
endfunction
call ale#linter#Define('hack', {
\ 'name': 'hack',
\ 'lsp': 'stdio',
\ 'executable_callback': 'ale_linters#hack#hack#GetExecutable',
2018-08-02 19:59:04 +00:00
\ 'command': '%e lsp --from vim-ale',
\ 'project_root_callback': 'ale_linters#hack#hack#GetProjectRoot',
\})