Skip to content

Commit dca5a0c

Browse files
undupsafont
authored andcommitted
Split the ocaml filetype into several filetypes
Now ocamlinterface ocamllex and menhir types must be taken into account as well. Menhir filetype is not included as there seem to be no plans to include it and even then it would take a big effort. The filetypes are introduced by ocaml/vim-ocaml#61
1 parent 857f17a commit dca5a0c

File tree

7 files changed

+54
-0
lines changed

7 files changed

+54
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
function! neomake#makers#ft#ocamlinterface#EnabledMakers() abort
2+
return ['merlin']
3+
endfunction
4+
5+
function! neomake#makers#ft#ocamlinterface#merlin() abort
6+
let maker = {}
7+
function! maker.get_list_entries(jobinfo)
8+
return merlin#ErrorLocList()
9+
endfunction
10+
return maker
11+
endfunction
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
function! neomake#makers#ft#ocamllex#EnabledMakers() abort
2+
return ['merlin']
3+
endfunction
4+
5+
function! neomake#makers#ft#ocamllex#merlin() abort
6+
let maker = {}
7+
function! maker.get_list_entries(jobinfo)
8+
return merlin#ErrorLocList()
9+
endfunction
10+
return maker
11+
endfunction

vim/merlin/dune

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@
1313
(ftdetect/merlin.vim as vim/ftdetect/merlin.vim)
1414
(ftplugin/merlin.vim as vim/ftplugin/merlin.vim)
1515
(ftplugin/ocaml.vim as vim/ftplugin/ocaml.vim)
16+
(ftplugin/ocamlinterface.vim as vim/ftplugin/ocamlinterface.vim)
17+
(ftplugin/ocamllex.vim as vim/ftplugin/ocamllex.vim)
1618
(ftplugin/omlet.vim as vim/ftplugin/omlet.vim)
1719
(ftplugin/reason.vim as vim/ftplugin/reason.vim)
1820
(plugin/merlin.vim as vim/plugin/merlin.vim)
1921
(syntax_checkers/ocaml/merlin.vim as vim/syntax_checkers/ocaml/merlin.vim)
22+
(syntax_checkers/ocamlinterface/merlin.vim as vim/syntax_checkers/ocamlinterface/merlin.vim)
2023
(syntax_checkers/omlet/merlin.vim as vim/syntax_checkers/omlet/merlin.vim)
2124
(syntax/merlin.vim as vim/syntax/merlin.vim)))

vim/merlin/ftplugin/menhir.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
" Activate merlin on current buffer
2+
call merlin#Register()
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
" Activate merlin on current buffer
2+
call merlin#Register()

vim/merlin/ftplugin/ocamllex.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
" Activate merlin on current buffer
2+
call merlin#Register()
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
" Enable Syntastic support
2+
" Make sure syntax_checkers directory is on runtime path, then set
3+
" :let g:syntastic_ocamlinterface_checkers=['merlin']
4+
5+
function! SyntaxCheckers_ocamlinterface_merlin_IsAvailable()
6+
if !exists("*merlin#SelectBinary")
7+
return 0
8+
endif
9+
try
10+
let l:path = merlin#SelectBinary()
11+
return executable(l:path)
12+
catch
13+
return 0
14+
endtry
15+
endfunction
16+
17+
function! SyntaxCheckers_ocamlinterface_merlin_GetLocList()
18+
return merlin#ErrorLocList()
19+
endfunction
20+
21+
call g:SyntasticRegistry.CreateAndRegisterChecker({
22+
\ 'filetype': 'ocamlinterface',
23+
\ 'name': 'merlin'})

0 commit comments

Comments
 (0)