Add vader test and fix command callback.

This commit is contained in:
Horacio Sanson 2018-08-26 22:11:36 +09:00
parent 228aee71a5
commit 261c29c3d0
2 changed files with 13 additions and 9 deletions

View file

@ -4,18 +4,12 @@
call ale#Set('java_javalsp_jar', 'javacs.jar')
function! ale_linters#java#javalsp#Executable(buffer) abort
let l:jar = ale#VarFunc('java_javalsp_jar')(a:buffer)
if filereadable(l:jar)
return 'java'
endif
return ''
return 'java'
endfunction
function! ale_linters#java#javalsp#Command(buffer) abort
let l:jar = ale#VarFunc('java_javalsp_jar')(a:buffer)
return 'exec java -cp ' . l:jar . ' -Xverify:none org.javacs.Main'
let l:jar = ale#Var(a:buffer, 'java_javalsp_jar')
return ale#Escape('java -cp ' . l:jar . ' -Xverify:none org.javacs.Main')
endfunction
call ale#linter#Define('java', {

View file

@ -0,0 +1,10 @@
Before:
call ale#assert#SetUpLinterTest('java', 'javalsp')
After:
call ale#assert#TearDownLinterTest()
Execute(The javalsp callback should return the correct default value):
AssertLinter 'java', ale#Escape('java -cp javacs.jar -Xverify:none org.javacs.Main')