summaryrefslogtreecommitdiff
path: root/ale_linters/hack
diff options
context:
space:
mode:
authorFred Emmott <fe@fb.com>2018-08-02 14:23:03 -0700
committerFred Emmott <fe@fb.com>2018-08-02 14:23:03 -0700
commite3c81911d698db95fdafb6df734d294aa27c303c (patch)
treeac1fa0555debe843ed5fdcf6431da3cd26137e35 /ale_linters/hack
parent9ef266d050d698c3ed3be3456ce6a5da5755d5ef (diff)
downloadale-e3c81911d698db95fdafb6df734d294aa27c303c.zip
Tell HHAST to only look at open files
Given ALE only cares about open files, this has no observable change, except for significantly reduced resource usage.
Diffstat (limited to 'ale_linters/hack')
-rw-r--r--ale_linters/hack/hhast.vim5
1 files changed, 5 insertions, 0 deletions
diff --git a/ale_linters/hack/hhast.vim b/ale_linters/hack/hhast.vim
index 5070dc4e..710b7b25 100644
--- a/ale_linters/hack/hhast.vim
+++ b/ale_linters/hack/hhast.vim
@@ -26,10 +26,15 @@ function! ale_linters#hack#hhast#GetExecutable(buffer) abort
return !empty(l:absolute) ? l:absolute : ''
endfunction
+function! ale_linters#hack#hhast#GetInitializationOptions(buffer) abort
+ return {'lintMode': 'open-files'}
+endfunction
+
call ale#linter#Define('hack', {
\ 'name': 'hhast',
\ 'lsp': 'stdio',
\ 'executable_callback': 'ale_linters#hack#hhast#GetExecutable',
\ 'command': '%e --mode lsp --from vim-ale',
\ 'project_root_callback': 'ale_linters#hack#hhast#GetProjectRoot',
+\ 'initialization_options_callback': 'ale_linters#hack#hhast#GetInitializationOptions',
\})