summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorMichael Jungo <michaeljungo92@gmail.com>2017-11-11 19:27:41 +0100
committerMichael Jungo <michaeljungo92@gmail.com>2017-11-11 19:27:41 +0100
commitf8fec369e5daa1be9c3b8e580655920422542f75 (patch)
tree956f0e513cf55945bbcc27e556dbad251ea59361 /autoload
parent9e7c493e7e6a5b7d22502aebda399e93d40a7974 (diff)
downloadale-f8fec369e5daa1be9c3b8e580655920422542f75.zip
Add ocaml-language-server for OCaml and ReasonML
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/handlers/ols.vim25
1 files changed, 25 insertions, 0 deletions
diff --git a/autoload/ale/handlers/ols.vim b/autoload/ale/handlers/ols.vim
new file mode 100644
index 00000000..1dda7f92
--- /dev/null
+++ b/autoload/ale/handlers/ols.vim
@@ -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