mirror of
1
0
Fork 0
ultimate-vim/sources_non_forked/ale/ale_linters/javascript/flow_ls.vim

29 lines
877 B
VimL
Raw Normal View History

2018-07-19 08:52:53 -04:00
" Author: t_t <jamestthompson3@gmail.com>
" Description: Integrate ALE with flow-language-server.
call ale#Set('javascript_flow_ls_executable', 'flow')
call ale#Set('javascript_flow_ls_use_global',
\ get(g:, 'ale_use_global_executables', 0)
\)
function! ale_linters#javascript#flow_ls#FindProjectRoot(buffer) abort
let l:flow_config = ale#path#FindNearestFile(a:buffer, '.flowconfig')
if !empty(l:flow_config)
return fnamemodify(l:flow_config, ':h')
endif
return ''
endfunction
call ale#linter#Define('javascript', {
\ 'name': 'flow-language-server',
\ 'lsp': 'stdio',
2021-05-31 16:30:26 -04:00
\ 'executable': {b -> ale#path#FindExecutable(b, 'javascript_flow_ls', [
2018-08-25 12:13:42 -04:00
\ 'node_modules/.bin/flow',
2019-03-08 06:04:56 -05:00
\ ])},
2018-08-25 12:13:42 -04:00
\ 'command': '%e lsp --from ale-lsp',
2019-03-08 06:04:56 -05:00
\ 'project_root': function('ale_linters#javascript#flow_ls#FindProjectRoot'),
2018-07-19 08:52:53 -04:00
\ 'language': 'javascript',
\})