From e3c81911d698db95fdafb6df734d294aa27c303c Mon Sep 17 00:00:00 2001 From: Fred Emmott Date: Thu, 2 Aug 2018 14:23:03 -0700 Subject: [PATCH] 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. --- ale_linters/hack/hhast.vim | 5 +++++ 1 file changed, 5 insertions(+) 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', \})