This repository has been archived on 2024-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
ale/ale_linters/reason/ls.vim

24 lines
700 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',
\ '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',
\})