mirror of
https://github.com/dense-analysis/ale.git
synced 2026-02-05 17:37:47 +08:00
Add ocaml-language-server for OCaml and ReasonML
This commit is contained in:
25
autoload/ale/handlers/ols.vim
Normal file
25
autoload/ale/handlers/ols.vim
Normal file
@@ -0,0 +1,25 @@
|
||||
" Author: Michael Jungo <michaeljungo92@gmail.com>
|
||||
" Description: Handlers for the OCaml language server
|
||||
|
||||
function! ale#handlers#ols#GetExecutable(buffer) abort
|
||||
let l:ols_setting = ale#handlers#ols#GetLanguage(a:buffer) . '_ols'
|
||||
return ale#node#FindExecutable(a:buffer, l:ols_setting, [
|
||||
\ 'node_modules/.bin/ocaml-language-server',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale#handlers#ols#GetCommand(buffer) abort
|
||||
let l:executable = ale#handlers#ols#GetExecutable(a:buffer)
|
||||
|
||||
return ale#node#Executable(a:buffer, l:executable) . ' --stdio'
|
||||
endfunction
|
||||
|
||||
function! ale#handlers#ols#GetLanguage(buffer) abort
|
||||
return getbufvar(a:buffer, '&filetype')
|
||||
endfunction
|
||||
|
||||
function! ale#handlers#ols#GetProjectRoot(buffer) abort
|
||||
let l:merlin_file = ale#path#FindNearestFile(a:buffer, '.merlin')
|
||||
|
||||
return !empty(l:merlin_file) ? fnamemodify(l:merlin_file, ':h') : ''
|
||||
endfunction
|
||||
Reference in New Issue
Block a user