Merge pull request #1778 from fredemmott/hhast-perf

Tell HHAST to only look at open files
This commit is contained in:
w0rp 2018-08-03 09:12:12 +01:00 committed by GitHub
commit fefb8efff8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,10 +26,15 @@ function! ale_linters#hack#hhast#GetExecutable(buffer) abort
return !empty(l:absolute) ? l:absolute : '' return !empty(l:absolute) ? l:absolute : ''
endfunction endfunction
function! ale_linters#hack#hhast#GetInitializationOptions(buffer) abort
return {'lintMode': 'open-files'}
endfunction
call ale#linter#Define('hack', { call ale#linter#Define('hack', {
\ 'name': 'hhast', \ 'name': 'hhast',
\ 'lsp': 'stdio', \ 'lsp': 'stdio',
\ 'executable_callback': 'ale_linters#hack#hhast#GetExecutable', \ 'executable_callback': 'ale_linters#hack#hhast#GetExecutable',
\ 'command': '%e --mode lsp --from vim-ale', \ 'command': '%e --mode lsp --from vim-ale',
\ 'project_root_callback': 'ale_linters#hack#hhast#GetProjectRoot', \ 'project_root_callback': 'ale_linters#hack#hhast#GetProjectRoot',
\ 'initialization_options_callback': 'ale_linters#hack#hhast#GetInitializationOptions',
\}) \})