mirror of
https://github.com/dense-analysis/ale
synced 2024-12-18 04:15:39 +00:00
22 lines
671 B
VimL
22 lines
671 B
VimL
" Author: David Buchan-Swanson <github@deecewan.com>
|
|
" Description: Integrate ALE with reason-language-server.
|
|
|
|
function! ale_linters#reason#reason_ls#FindProjectRoot(buffer) abort
|
|
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',
|
|
\ 'lsp': 'stdio',
|
|
\ 'executable':{buffer -> ale#Var(buffer, 'reason_ls_executable')},
|
|
\ 'command': '%e',
|
|
\ 'project_root': function('ale_linters#reason#reason_ls#FindProjectRoot'),
|
|
\ 'language': 'reason',
|
|
\})
|