X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/0ee596c5c5e11fc79598407eaf22f83d279f7e9e..5a4872f466ebd76ddd532bdf2798554421c53df4:/.vim/bundle/ale/ale_linters/hack/hack.vim?ds=sidebyside diff --git a/.vim/bundle/ale/ale_linters/hack/hack.vim b/.vim/bundle/ale/ale_linters/hack/hack.vim new file mode 100644 index 00000000..822b5c87 --- /dev/null +++ b/.vim/bundle/ale/ale_linters/hack/hack.vim @@ -0,0 +1,22 @@ +" Author: Fred Emmott +" 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', +\ 'executable': function('ale_linters#hack#hack#GetExecutable'), +\ 'command': '%e lsp --from vim-ale', +\ 'project_root': function('ale_linters#hack#hack#GetProjectRoot'), +\})