2018-08-24 03:20:44 -04:00
|
|
|
" Author: Horacio Sanson <https://github.com/hsanson>
|
|
|
|
" Description: Support for the Java language server https://github.com/georgewfraser/vscode-javac
|
|
|
|
|
|
|
|
call ale#Set('java_javalsp_jar', 'javacs.jar')
|
|
|
|
|
|
|
|
function! ale_linters#java#javalsp#Executable(buffer) abort
|
2018-08-26 09:11:36 -04:00
|
|
|
return 'java'
|
2018-08-24 03:20:44 -04:00
|
|
|
endfunction
|
|
|
|
|
|
|
|
function! ale_linters#java#javalsp#Command(buffer) abort
|
2018-08-26 09:11:36 -04:00
|
|
|
let l:jar = ale#Var(a:buffer, 'java_javalsp_jar')
|
|
|
|
return ale#Escape('java -cp ' . l:jar . ' -Xverify:none org.javacs.Main')
|
2018-08-24 03:20:44 -04:00
|
|
|
endfunction
|
|
|
|
|
|
|
|
call ale#linter#Define('java', {
|
|
|
|
\ 'name': 'javalsp',
|
|
|
|
\ 'lsp': 'stdio',
|
|
|
|
\ 'executable_callback': 'ale_linters#java#javalsp#Executable',
|
|
|
|
\ 'command_callback': 'ale_linters#java#javalsp#Command',
|
|
|
|
\ 'language': 'java',
|
|
|
|
\ 'project_root_callback': 'ale#java#FindProjectRoot',
|
|
|
|
\})
|