summaryrefslogtreecommitdiff
path: root/ale_linters/java/eclipselsp.vim
diff options
context:
space:
mode:
authorHoracio Sanson <horacio@allm.inc>2020-04-25 15:21:09 +0900
committerHoracio Sanson <horacio@allm.inc>2020-04-25 15:21:09 +0900
commite641fe0c5dc3773054aa35fd42efbcfdcd1b7bbb (patch)
tree95242353f5e574da53e4417fc80f1dd21bd817e7 /ale_linters/java/eclipselsp.vim
parent36e5337e30095afb10d02ef2ae362c8d6055e70d (diff)
downloadale-e641fe0c5dc3773054aa35fd42efbcfdcd1b7bbb.zip
Fix eclipselsp command function.
Changes in eclipselsp and java caused the command needed to run the language server fail to build properly. Thi PR fixes those issues.
Diffstat (limited to 'ale_linters/java/eclipselsp.vim')
-rw-r--r--ale_linters/java/eclipselsp.vim22
1 files changed, 15 insertions, 7 deletions
diff --git a/ale_linters/java/eclipselsp.vim b/ale_linters/java/eclipselsp.vim
index 2648893b..a2691212 100644
--- a/ale_linters/java/eclipselsp.vim
+++ b/ale_linters/java/eclipselsp.vim
@@ -19,25 +19,32 @@ endfunction
function! ale_linters#java#eclipselsp#JarPath(buffer) abort
let l:path = ale_linters#java#eclipselsp#TargetPath(a:buffer)
+ if has('win32')
+ let l:platform = 'win32'
+ elseif has('macunix')
+ let l:platform = 'macosx'
+ else
+ let l:platform = 'linux'
+ endif
+
" 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)
+ 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]
endif
" 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]
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
+ if len(l:files) > 1
return l:files[0]
endif
@@ -147,7 +154,8 @@ function! ale_linters#java#eclipselsp#RunWithVersionCheck(buffer) abort
return ale#command#Run(
\ a:buffer,
\ l:command,
- \ function('ale_linters#java#eclipselsp#CommandWithVersion')
+ \ function('ale_linters#java#eclipselsp#CommandWithVersion'),
+ \ { 'output_stream': 'both' }
\)
endfunction