diff options
Diffstat (limited to 'ale_linters/java/eclipselsp.vim')
-rw-r--r-- | ale_linters/java/eclipselsp.vim | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/ale_linters/java/eclipselsp.vim b/ale_linters/java/eclipselsp.vim index af9a325e..d0ea9d6c 100644 --- a/ale_linters/java/eclipselsp.vim +++ b/ale_linters/java/eclipselsp.vim @@ -3,7 +3,7 @@ let s:version_cache = {} -call ale#Set('java_eclipselsp_path', 'eclipse.jdt.ls') +call ale#Set('java_eclipselsp_path', ale#path#Simplify($HOME . '/eclipse.jdt.ls')) call ale#Set('java_eclipselsp_executable', 'java') function! ale_linters#java#eclipselsp#Executable(buffer) abort @@ -16,20 +16,27 @@ endfunction function! ale_linters#java#eclipselsp#JarPath(buffer) abort let l:path = ale_linters#java#eclipselsp#TargetPath(a:buffer) - let l:path = l:path . '/org.eclipse.jdt.ls.product/target/repository/plugins' - let l:files = globpath(l:path, 'org.eclipse.equinox.launcher_*.jar', 1, 1) + " Search jar file within repository path when manually built using mvn + let l:repo_path = l:path . '/org.eclipse.jdt.ls.product/target/repository' + let l:files = globpath(l:repo_path, '**/plugins/org.eclipse.equinox.launcher_\d\.\d\.\d\d\d\.*\.jar', 1, 1) - if empty(l:files) - return '' + if len(l:files) == 1 + return l:files[0] endif - return l:files[0] + " Search jar file within VSCode extensions folder. + let l:files = globpath(l:path, '**/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 = ale_linters#java#eclipselsp#TargetPath(a:buffer) - let l:path = l:path . '/org.eclipse.jdt.ls.product/target/repository' + let l:path = fnamemodify(ale_linters#java#eclipselsp#JarPath(a:buffer), ':p:h:h') if has('win32') let l:path = l:path . '/config_win' |