summaryrefslogtreecommitdiff
path: root/ale_linters/java/eclipselsp.vim
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters/java/eclipselsp.vim')
-rw-r--r--ale_linters/java/eclipselsp.vim13
1 files changed, 13 insertions, 0 deletions
diff --git a/ale_linters/java/eclipselsp.vim b/ale_linters/java/eclipselsp.vim
index d0ea9d6c..c0b476a3 100644
--- a/ale_linters/java/eclipselsp.vim
+++ b/ale_linters/java/eclipselsp.vim
@@ -4,6 +4,7 @@
let s:version_cache = {}
call ale#Set('java_eclipselsp_path', ale#path#Simplify($HOME . '/eclipse.jdt.ls'))
+call ale#Set('java_eclipselsp_config_path', '')
call ale#Set('java_eclipselsp_executable', 'java')
function! ale_linters#java#eclipselsp#Executable(buffer) abort
@@ -32,11 +33,23 @@ function! ale_linters#java#eclipselsp#JarPath(buffer) abort
return l:files[0]
endif
+ " Search jar file within system package path
+ let l:files = globpath('/usr/share/java/jdtls/plugins', 'org.eclipse.equinox.launcher_\d\.\d\.\d\d\d\.*\.jar', 1, 1)
+
+ if len(l:files) == 1
+ return l:files[0]
+ endif
+
return ''
endfunction
function! ale_linters#java#eclipselsp#ConfigurationPath(buffer) abort
let l:path = fnamemodify(ale_linters#java#eclipselsp#JarPath(a:buffer), ':p:h:h')
+ let l:config_path = ale#Var(a:buffer, 'java_eclipselsp_config_path')
+
+ if !empty(l:config_path)
+ return ale#path#Simplify(l:config_path)
+ endif
if has('win32')
let l:path = l:path . '/config_win'