Add vader test and fix command callback.
This commit is contained in:
parent
228aee71a5
commit
261c29c3d0
@ -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', {
|
||||||
|
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')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user