ale/ale_linters/reason/ls.vim

25 lines
730 B
VimL
Raw Normal View History

2019-04-11 05:24:47 +00:00
" Author: David Buchan-Swanson <github@deecewan.com>
" Description: Integrate ALE with reason-language-server.
call ale#Set('reason_ls_executable', '')
function! ale_linters#reason#ls#FindProjectRoot(buffer) abort
2019-04-11 05:24:47 +00:00
let l:reason_config = ale#path#FindNearestFile(a:buffer, 'bsconfig.json')
if !empty(l:reason_config)
return fnamemodify(l:reason_config, ':h')
endif
return ''
endfunction
call ale#linter#Define('reason', {
\ 'name': 'reason-language-server',
\ 'aliases': ['reason_ls'],
2019-04-11 05:24:47 +00:00
\ 'lsp': 'stdio',
\ 'executable': {buffer -> ale#Var(buffer, 'reason_ls_executable')},
2019-04-11 05:24:47 +00:00
\ 'command': '%e',
\ 'project_root': function('ale_linters#reason#ls#FindProjectRoot'),
2019-04-11 05:24:47 +00:00
\ 'language': 'reason',
\})