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')
|
||||
|
||||
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', {
|
||||
|
|
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