mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-07 05:04:28 +08:00
Merge pull request #3137 from hsanson/3132-fix-eclipselsp-command
Fix eclipselsp command function.
This commit is contained in:
@@ -20,25 +20,32 @@ endfunction
|
|||||||
function! ale_linters#java#eclipselsp#JarPath(buffer) abort
|
function! ale_linters#java#eclipselsp#JarPath(buffer) abort
|
||||||
let l:path = ale_linters#java#eclipselsp#TargetPath(a:buffer)
|
let l:path = ale_linters#java#eclipselsp#TargetPath(a:buffer)
|
||||||
|
|
||||||
" Search jar file within repository path when manually built using mvn
|
if has('win32')
|
||||||
let l:repo_path = l:path . '/org.eclipse.jdt.ls.product/target/repository'
|
let l:platform = 'win32'
|
||||||
let l:files = globpath(l:repo_path, '**/plugins/org.eclipse.equinox.launcher_\d\.\d\.\d\d\d\.*\.jar', 1, 1)
|
elseif has('macunix')
|
||||||
|
let l:platform = 'macosx'
|
||||||
|
else
|
||||||
|
let l:platform = 'linux'
|
||||||
|
endif
|
||||||
|
|
||||||
if len(l:files) == 1
|
" Search jar file within repository path when manually built using mvn
|
||||||
|
let l:files = globpath(l:path, '**/'.l:platform.'/**/plugins/org.eclipse.equinox.launcher_\d\.\d\.\d\d\d\.*\.jar', 1, 1)
|
||||||
|
|
||||||
|
if len(l:files) > 1
|
||||||
return l:files[0]
|
return l:files[0]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Search jar file within VSCode extensions folder.
|
" 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)
|
let l:files = globpath(l:path, '**/'.l:platform.'/plugins/org.eclipse.equinox.launcher_\d\.\d\.\d\d\d\.*\.jar', 1, 1)
|
||||||
|
|
||||||
if len(l:files) == 1
|
if len(l:files) > 1
|
||||||
return l:files[0]
|
return l:files[0]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Search jar file within system package path
|
" 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)
|
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
|
if len(l:files) > 1
|
||||||
return l:files[0]
|
return l:files[0]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -166,7 +173,8 @@ function! ale_linters#java#eclipselsp#RunWithVersionCheck(buffer) abort
|
|||||||
return ale#command#Run(
|
return ale#command#Run(
|
||||||
\ a:buffer,
|
\ a:buffer,
|
||||||
\ l:command,
|
\ l:command,
|
||||||
\ function('ale_linters#java#eclipselsp#CommandWithVersion')
|
\ function('ale_linters#java#eclipselsp#CommandWithVersion'),
|
||||||
|
\ { 'output_stream': 'both' }
|
||||||
\)
|
\)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user