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
|
|
|
|
|
2018-12-05 07:27:02 -05:00
|
|
|
call ale#Set('java_javalsp_executable', 'java')
|
2018-08-24 03:20:44 -04:00
|
|
|
|
|
|
|
function! ale_linters#java#javalsp#Executable(buffer) abort
|
2018-12-05 07:27:02 -05:00
|
|
|
return ale#Var(a:buffer, 'java_javalsp_executable')
|
2018-08-24 03:20:44 -04:00
|
|
|
endfunction
|
|
|
|
|
|
|
|
function! ale_linters#java#javalsp#Command(buffer) abort
|
2018-12-05 07:27:02 -05:00
|
|
|
let l:executable = ale_linters#java#javalsp#Executable(a:buffer)
|
2018-09-04 11:51:18 -04:00
|
|
|
|
2019-02-07 04:35:24 -05:00
|
|
|
return ale#Escape(l:executable) . ' -Xverify:none -m javacs/org.javacs.Main'
|
2018-08-24 03:20:44 -04:00
|
|
|
endfunction
|
|
|
|
|
|
|
|
call ale#linter#Define('java', {
|
|
|
|
\ 'name': 'javalsp',
|
|
|
|
\ 'lsp': 'stdio',
|
2019-02-22 13:05:04 -05:00
|
|
|
\ 'executable': function('ale_linters#java#javalsp#Executable'),
|
|
|
|
\ 'command': function('ale_linters#java#javalsp#Command'),
|
2018-08-24 03:20:44 -04:00
|
|
|
\ 'language': 'java',
|
2019-02-22 13:05:04 -05:00
|
|
|
\ 'project_root': function('ale#java#FindProjectRoot'),
|
2018-08-24 03:20:44 -04:00
|
|
|
\})
|