]> git.madduck.net Git - etc/vim.git/blob - autoload/ale/handlers/ols.vim

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Squashed '.vim/bundle/ale/' content from commit 22185c4c
[etc/vim.git] / autoload / ale / handlers / ols.vim
1 " Author: Michael Jungo <michaeljungo92@gmail.com>
2 " Description: Handlers for the OCaml language server
3
4 function! ale#handlers#ols#GetExecutable(buffer) abort
5     let l:ols_setting = ale#handlers#ols#GetLanguage(a:buffer) . '_ols'
6
7     return ale#path#FindExecutable(a:buffer, l:ols_setting, [
8     \   'node_modules/.bin/ocaml-language-server',
9     \])
10 endfunction
11
12 function! ale#handlers#ols#GetCommand(buffer) abort
13     let l:executable = ale#handlers#ols#GetExecutable(a:buffer)
14
15     return ale#node#Executable(a:buffer, l:executable) . ' --stdio'
16 endfunction
17
18 function! ale#handlers#ols#GetLanguage(buffer) abort
19     return getbufvar(a:buffer, '&filetype')
20 endfunction
21
22 function! ale#handlers#ols#GetProjectRoot(buffer) abort
23     let l:merlin_file = ale#path#FindNearestFile(a:buffer, '.merlin')
24
25     return !empty(l:merlin_file) ? fnamemodify(l:merlin_file, ':h') : ''
26 endfunction