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') call ale#Set('java_javalsp_jar', 'javacs.jar')
function! ale_linters#java#javalsp#Executable(buffer) abort function! ale_linters#java#javalsp#Executable(buffer) abort
let l:jar = ale#VarFunc('java_javalsp_jar')(a:buffer) return 'java'
if filereadable(l:jar)
return 'java'
endif
return ''
endfunction endfunction
function! ale_linters#java#javalsp#Command(buffer) abort function! ale_linters#java#javalsp#Command(buffer) abort
let l:jar = ale#VarFunc('java_javalsp_jar')(a:buffer) let l:jar = ale#Var(a:buffer, 'java_javalsp_jar')
return 'exec java -cp ' . l:jar . ' -Xverify:none org.javacs.Main' return ale#Escape('java -cp ' . l:jar . ' -Xverify:none org.javacs.Main')
endfunction endfunction
call ale#linter#Define('java', { 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')