mirror of
https://github.com/dense-analysis/ale
synced 2024-12-22 06:10:07 +00:00
Add support for reason-language-server
This commit is contained in:
parent
59829bc194
commit
92d515c211
21
ale_linters/reason/reason_ls.vim
Normal file
21
ale_linters/reason/reason_ls.vim
Normal file
@ -0,0 +1,21 @@
|
||||
" 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',
|
||||
\})
|
@ -33,6 +33,22 @@ g:ale_reason_ols_use_global *g:ale_reason_ols_use_global*
|
||||
This variable can be set to `1` to always use the globally installed
|
||||
executable. See also |ale-integrations-local-executables|.
|
||||
|
||||
===============================================================================
|
||||
reason-language-server *ale-reasonml-language-server*
|
||||
|
||||
Note: You *must* set an executable - there is no 'default' install location.
|
||||
Go to https://github.com/jaredly/reason-language-server and download the
|
||||
latest release. You can place it anywhere, but ensure you set the executable
|
||||
path.
|
||||
|
||||
g:ale_reason_ls_executable *g:ale_reason_ls_executable*
|
||||
*b:ale_reason_ls_executable*
|
||||
Type: |String|
|
||||
|
||||
This variable defines the standard location of the language server
|
||||
executable. This *must* be set.
|
||||
|
||||
|
||||
===============================================================================
|
||||
refmt *ale-reasonml-refmt*
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user