diff options
author | w0rp <w0rp@users.noreply.github.com> | 2018-08-02 21:58:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-02 21:58:57 +0100 |
commit | 9ef266d050d698c3ed3be3456ce6a5da5755d5ef (patch) | |
tree | 6e3d82e5df785173b6f067ddfd4b32a75fb9cef6 /ale_linters/hack/hack.vim | |
parent | 94270402cb5c28017061c383c40dff89008d0125 (diff) | |
parent | a728f074f727ad9aac0d6947f7b81d26078c0fb6 (diff) | |
download | ale-9ef266d050d698c3ed3be3456ce6a5da5755d5ef.zip |
Merge pull request #1770 from fredemmott/hack
Split Hack out from PHP, modernize
Diffstat (limited to 'ale_linters/hack/hack.vim')
-rw-r--r-- | ale_linters/hack/hack.vim | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ale_linters/hack/hack.vim b/ale_linters/hack/hack.vim new file mode 100644 index 00000000..aea428cc --- /dev/null +++ b/ale_linters/hack/hack.vim @@ -0,0 +1,22 @@ +" 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', +\ 'executable_callback': 'ale_linters#hack#hack#GetExecutable', +\ 'command': '%e lsp --from vim-ale', +\ 'project_root_callback': 'ale_linters#hack#hack#GetProjectRoot', +\}) |