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