diff --git a/vim/merlin/autoload/neomake/makers/ft/menhir.vim b/vim/merlin/autoload/neomake/makers/ft/menhir.vim new file mode 100644 index 0000000000..b102aa668f --- /dev/null +++ b/vim/merlin/autoload/neomake/makers/ft/menhir.vim @@ -0,0 +1,11 @@ +function! neomake#makers#ft#menhir#EnabledMakers() abort + return ['merlin'] +endfunction + +function! neomake#makers#ft#menhir#merlin() abort + let maker = {} + function! maker.get_list_entries(jobinfo) + return merlin#ErrorLocList() + endfunction + return maker +endfunction diff --git a/vim/merlin/autoload/neomake/makers/ft/ocamlinterface.vim b/vim/merlin/autoload/neomake/makers/ft/ocamlinterface.vim new file mode 100644 index 0000000000..61772ca8da --- /dev/null +++ b/vim/merlin/autoload/neomake/makers/ft/ocamlinterface.vim @@ -0,0 +1,11 @@ +function! neomake#makers#ft#ocamlinterface#EnabledMakers() abort + return ['merlin'] +endfunction + +function! neomake#makers#ft#ocamlinterface#merlin() abort + let maker = {} + function! maker.get_list_entries(jobinfo) + return merlin#ErrorLocList() + endfunction + return maker +endfunction diff --git a/vim/merlin/autoload/neomake/makers/ft/ocamllex.vim b/vim/merlin/autoload/neomake/makers/ft/ocamllex.vim new file mode 100644 index 0000000000..9e6e96bc5e --- /dev/null +++ b/vim/merlin/autoload/neomake/makers/ft/ocamllex.vim @@ -0,0 +1,11 @@ +function! neomake#makers#ft#ocamllex#EnabledMakers() abort + return ['merlin'] +endfunction + +function! neomake#makers#ft#ocamllex#merlin() abort + let maker = {} + function! maker.get_list_entries(jobinfo) + return merlin#ErrorLocList() + endfunction + return maker +endfunction diff --git a/vim/merlin/dune b/vim/merlin/dune index 40c3348604..cc482a4435 100644 --- a/vim/merlin/dune +++ b/vim/merlin/dune @@ -11,11 +11,17 @@ (autoload/merlin_visual.vim as vim/autoload/merlin_visual.vim) (doc/merlin.txt as vim/doc/merlin.txt) (ftdetect/merlin.vim as vim/ftdetect/merlin.vim) + (ftplugin/menhir.vim as vim/ftplugin/menhir.vim) (ftplugin/merlin.vim as vim/ftplugin/merlin.vim) (ftplugin/ocaml.vim as vim/ftplugin/ocaml.vim) + (ftplugin/ocamlinterface.vim as vim/ftplugin/ocamlinterface.vim) + (ftplugin/ocamllex.vim as vim/ftplugin/ocamllex.vim) (ftplugin/omlet.vim as vim/ftplugin/omlet.vim) (ftplugin/reason.vim as vim/ftplugin/reason.vim) (plugin/merlin.vim as vim/plugin/merlin.vim) + (syntax_checkers/menhir/merlin.vim as vim/syntax_checkers/menhir/merlin.vim) (syntax_checkers/ocaml/merlin.vim as vim/syntax_checkers/ocaml/merlin.vim) + (syntax_checkers/ocamlinterface/merlin.vim as vim/syntax_checkers/ocamlinterface/merlin.vim) + (syntax_checkers/ocamllex/merlin.vim as vim/syntax_checkers/ocamllex/merlin.vim) (syntax_checkers/omlet/merlin.vim as vim/syntax_checkers/omlet/merlin.vim) (syntax/merlin.vim as vim/syntax/merlin.vim))) diff --git a/vim/merlin/ftplugin/menhir.vim b/vim/merlin/ftplugin/menhir.vim new file mode 100644 index 0000000000..2e33e14808 --- /dev/null +++ b/vim/merlin/ftplugin/menhir.vim @@ -0,0 +1,2 @@ +" Activate merlin on current buffer +call merlin#Register() diff --git a/vim/merlin/ftplugin/ocamlinterface.vim b/vim/merlin/ftplugin/ocamlinterface.vim new file mode 100644 index 0000000000..2e33e14808 --- /dev/null +++ b/vim/merlin/ftplugin/ocamlinterface.vim @@ -0,0 +1,2 @@ +" Activate merlin on current buffer +call merlin#Register() diff --git a/vim/merlin/ftplugin/ocamllex.vim b/vim/merlin/ftplugin/ocamllex.vim new file mode 100644 index 0000000000..2e33e14808 --- /dev/null +++ b/vim/merlin/ftplugin/ocamllex.vim @@ -0,0 +1,2 @@ +" Activate merlin on current buffer +call merlin#Register() diff --git a/vim/merlin/syntax_checkers/menhir/merlin.vim b/vim/merlin/syntax_checkers/menhir/merlin.vim new file mode 100644 index 0000000000..9e76254603 --- /dev/null +++ b/vim/merlin/syntax_checkers/menhir/merlin.vim @@ -0,0 +1,23 @@ +" Enable Syntastic support +" Make sure syntax_checkers directory is on runtime path, then set +" :let g:syntastic_menhir_checkers=['merlin'] + +function! SyntaxCheckers_menhir_merlin_IsAvailable() + if !exists("*merlin#SelectBinary") + return 0 + endif + try + let l:path = merlin#SelectBinary() + return executable(l:path) + catch + return 0 + endtry +endfunction + +function! SyntaxCheckers_menhir_merlin_GetLocList() + return merlin#ErrorLocList() +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'menhir', + \ 'name': 'merlin'}) diff --git a/vim/merlin/syntax_checkers/ocamlinterface/merlin.vim b/vim/merlin/syntax_checkers/ocamlinterface/merlin.vim new file mode 100644 index 0000000000..e5702ac482 --- /dev/null +++ b/vim/merlin/syntax_checkers/ocamlinterface/merlin.vim @@ -0,0 +1,23 @@ +" Enable Syntastic support +" Make sure syntax_checkers directory is on runtime path, then set +" :let g:syntastic_ocamlinterface_checkers=['merlin'] + +function! SyntaxCheckers_ocamlinterface_merlin_IsAvailable() + if !exists("*merlin#SelectBinary") + return 0 + endif + try + let l:path = merlin#SelectBinary() + return executable(l:path) + catch + return 0 + endtry +endfunction + +function! SyntaxCheckers_ocamlinterface_merlin_GetLocList() + return merlin#ErrorLocList() +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'ocamlinterface', + \ 'name': 'merlin'}) diff --git a/vim/merlin/syntax_checkers/ocamllex/merlin.vim b/vim/merlin/syntax_checkers/ocamllex/merlin.vim new file mode 100644 index 0000000000..b5960e1b44 --- /dev/null +++ b/vim/merlin/syntax_checkers/ocamllex/merlin.vim @@ -0,0 +1,23 @@ +" Enable Syntastic support +" Make sure syntax_checkers directory is on runtime path, then set +" :let g:syntastic_ocamllex_checkers=['merlin'] + +function! SyntaxCheckers_ocamllex_merlin_IsAvailable() + if !exists("*merlin#SelectBinary") + return 0 + endif + try + let l:path = merlin#SelectBinary() + return executable(l:path) + catch + return 0 + endtry +endfunction + +function! SyntaxCheckers_ocamllex_merlin_GetLocList() + return merlin#ErrorLocList() +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'ocamllex', + \ 'name': 'merlin'})