2017-11-12 01:06:28 +00:00
|
|
|
Before:
|
2018-07-15 17:24:53 +00:00
|
|
|
call ale#assert#SetUpLinterTest('ocaml', 'ols')
|
2017-11-12 01:06:28 +00:00
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
Save &filetype
|
2017-11-12 01:06:28 +00:00
|
|
|
let &filetype = 'ocaml'
|
|
|
|
|
|
|
|
After:
|
2018-07-15 17:24:53 +00:00
|
|
|
call ale#assert#TearDownLinterTest()
|
2017-11-12 01:06:28 +00:00
|
|
|
|
|
|
|
Execute(The language string should be correct):
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLSPLanguage 'ocaml'
|
2017-11-12 01:06:28 +00:00
|
|
|
|
|
|
|
Execute(The default executable should be correct):
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'ocaml-language-server',
|
|
|
|
\ ale#Escape('ocaml-language-server') . ' --stdio'
|
2017-11-12 01:06:28 +00:00
|
|
|
|
|
|
|
Execute(The project root should be detected correctly):
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLSPProject ''
|
2017-11-12 01:06:28 +00:00
|
|
|
|
|
|
|
call ale#test#SetFilename('ols_paths/file.ml')
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLSPProject ale#path#Simplify(g:dir . '/ols_paths')
|
2017-11-12 01:06:28 +00:00
|
|
|
|
|
|
|
Execute(The local executable should be used when available):
|
|
|
|
call ale#test#SetFilename('ols_paths/file.ml')
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter ale#path#Simplify(g:dir . '/ols_paths/node_modules/.bin/ocaml-language-server'),
|
|
|
|
\ ale#Escape(ale#path#Simplify(g:dir . '/ols_paths/node_modules/.bin/ocaml-language-server')) . ' --stdio'
|
2017-11-12 01:06:28 +00:00
|
|
|
|
|
|
|
Execute(The gloabl executable should always be used when use_global is set):
|
|
|
|
let g:ale_ocaml_ols_use_global = 1
|
|
|
|
call ale#test#SetFilename('ols_paths/file.ml')
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'ocaml-language-server',
|
|
|
|
\ ale#Escape('ocaml-language-server') . ' --stdio'
|
2017-11-12 01:06:28 +00:00
|
|
|
|
|
|
|
Execute(The executable should be configurable):
|
|
|
|
let g:ale_ocaml_ols_executable = 'foobar'
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'foobar', ale#Escape('foobar') . ' --stdio'
|