summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ale_linters/java/javalsp.vim12
-rw-r--r--test/command_callback/test_javalsp_command_callback.vader10
2 files changed, 13 insertions, 9 deletions
diff --git a/ale_linters/java/javalsp.vim b/ale_linters/java/javalsp.vim
index fa1fe4cb..f335e83c 100644
--- a/ale_linters/java/javalsp.vim
+++ b/ale_linters/java/javalsp.vim
@@ -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', {
diff --git a/test/command_callback/test_javalsp_command_callback.vader b/test/command_callback/test_javalsp_command_callback.vader
new file mode 100644
index 00000000..1fbfddfb
--- /dev/null
+++ b/test/command_callback/test_javalsp_command_callback.vader
@@ -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')
+