summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2019-06-10 19:15:15 +0100
committerGitHub <noreply@github.com>2019-06-10 19:15:15 +0100
commit1ba1a9ef0e0d6ea9331498dd84196de3e494e4a0 (patch)
tree4fb7772a77576033b40dd04f04dc7b40483e3bab /ale_linters
parentfea666bd27a0e2eb41868f30ae23121c72f4fe65 (diff)
parente84c9b300b521134ed3d37b8d59beff8b83ae61e (diff)
downloadale-1ba1a9ef0e0d6ea9331498dd84196de3e494e4a0.zip
Merge pull request #2558 from hsanson/fix-javalsp-command-callback
Fix javalsp command callback.
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/java/javalsp.vim22
1 files changed, 20 insertions, 2 deletions
diff --git a/ale_linters/java/javalsp.vim b/ale_linters/java/javalsp.vim
index a327363d..f56675d6 100644
--- a/ale_linters/java/javalsp.vim
+++ b/ale_linters/java/javalsp.vim
@@ -1,7 +1,7 @@
" 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_executable', 'java')
+call ale#Set('java_javalsp_executable', '')
function! ale_linters#java#javalsp#Executable(buffer) abort
return ale#Var(a:buffer, 'java_javalsp_executable')
@@ -10,7 +10,25 @@ endfunction
function! ale_linters#java#javalsp#Command(buffer) abort
let l:executable = ale_linters#java#javalsp#Executable(a:buffer)
- return ale#Escape(l:executable) . ' -Xverify:none -m javacs/org.javacs.Main'
+ if fnamemodify(l:executable, ':t') is# 'java'
+ " For backward compatibility.
+ let l:cmd = [
+ \ ale#Escape(l:executable),
+ \ '--add-exports jdk.compiler/com.sun.tools.javac.api=javacs',
+ \ '--add-exports jdk.compiler/com.sun.tools.javac.code=javacs',
+ \ '--add-exports jdk.compiler/com.sun.tools.javac.comp=javacs',
+ \ '--add-exports jdk.compiler/com.sun.tools.javac.main=javacs',
+ \ '--add-exports jdk.compiler/com.sun.tools.javac.tree=javacs',
+ \ '--add-exports jdk.compiler/com.sun.tools.javac.model=javacs',
+ \ '--add-exports jdk.compiler/com.sun.tools.javac.util=javacs',
+ \ '--add-opens jdk.compiler/com.sun.tools.javac.api=javacs',
+ \ '-m javacs/org.javacs.Main',
+ \]
+
+ return join(l:cmd, ' ')
+ else
+ return ale#Escape(l:executable)
+ endif
endfunction
call ale#linter#Define('java', {