1
0
Fork 0
mirror of synced 2024-11-17 22:45:34 -05:00
ultimate-vim/sources_non_forked/ale/ale_linters/javascript/tsserver.vim
Amir Salihefendic 2f164fee9b Updated plugins
2018-07-04 12:53:25 +02:00

26 lines
1,002 B
VimL

" Author: Chaucerbao, w0rp <devw0rp@gmail.com>
" Description: tsserver integration for ALE
call ale#Set('javascript_tsserver_executable', 'tsserver')
call ale#Set('javascript_tsserver_config_path', '')
call ale#Set('javascript_tsserver_use_global', get(g:, 'ale_use_global_executables', 0))
" These functions need to be defined just to comply with the API for LSP.
function! ale_linters#javascript#tsserver#GetProjectRoot(buffer) abort
return ''
endfunction
function! ale_linters#javascript#tsserver#GetExecutable(buffer) abort
return ale#node#FindExecutable(a:buffer, 'javascript_tsserver', [
\ 'node_modules/.bin/tsserver',
\])
endfunction
call ale#linter#Define('javascript', {
\ 'name': 'tsserver',
\ 'lsp': 'tsserver',
\ 'executable_callback': 'ale_linters#javascript#tsserver#GetExecutable',
\ 'command_callback': 'ale_linters#javascript#tsserver#GetExecutable',
\ 'project_root_callback': 'ale_linters#javascript#tsserver#GetProjectRoot',
\ 'language': '',
\})