Add vader test and fix command callback.
This commit is contained in:
parent
228aee71a5
commit
261c29c3d0
2 changed files with 13 additions and 9 deletions
|
@ -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)
|
|
||||||
|
|
||||||
if filereadable(l:jar)
|
|
||||||
return 'java'
|
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', {
|
||||||
|
|
10
test/command_callback/test_javalsp_command_callback.vader
Normal file
10
test/command_callback/test_javalsp_command_callback.vader
Normal 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')
|
||||||
|
|
Reference in a new issue