From a02a4f2811f810877f3c3859cca963f9578ff94a Mon Sep 17 00:00:00 2001 From: Pau Ruiz Safont Date: Thu, 27 May 2021 08:33:43 +0100 Subject: ocaml: prepare for filetype separation (#3732) The ocaml filetype is currently used for several, different file formats. This causes problems as not all tools support all formats. New filetypes are introduced to support this separation, this needs some changes in ale that are fortunately backwards-compatible. These change add ocamlinterface file support for ocp-indent, merlin, ocamlformat and ocaml-lsp. For ocaml-lsp I took the liberty to add all recognised language ids, even if they are not supported. ols has not been changed as the project has been abandoned since 2019. --- test/linter/test_ocamlinterface_ocamllsp.vader | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 test/linter/test_ocamlinterface_ocamllsp.vader (limited to 'test/linter/test_ocamlinterface_ocamllsp.vader') diff --git a/test/linter/test_ocamlinterface_ocamllsp.vader b/test/linter/test_ocamlinterface_ocamllsp.vader new file mode 100644 index 00000000..aa0b2100 --- /dev/null +++ b/test/linter/test_ocamlinterface_ocamllsp.vader @@ -0,0 +1,29 @@ +Before: + call ale#assert#SetUpLinterTest('ocamlinterface', 'ocamllsp') + + Save &filetype + let &filetype = 'ocamlinterface' + +After: + call ale#assert#TearDownLinterTest() + +Execute(The language string should be correct): + AssertLSPLanguage 'ocaml.interface' + +Execute(The project root should be detected correctly): + AssertLSPProject '' + + call ale#test#SetFilename('../test-files/ocamllsp/file.ml') + + AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/ocamllsp') + +Execute(The executable should be run using opam exec by default): + call ale#test#SetFilename('../test-files/ocamllsp/file.ml') + + AssertLinter 'ocamllsp', 'opam config exec -- ocamllsp' + +Execute(The executable should be run directly if use_opam flag is disabled): + let g:ale_ocaml_ocamllsp_use_opam = 0 + call ale#test#SetFilename('../test-files/ocamllsp/file.ml') + + AssertLinter 'ocamllsp', 'ocamllsp' -- cgit v1.2.3