diff options
author | w0rp <w0rp@users.noreply.github.com> | 2019-05-23 12:05:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-23 12:05:21 +0100 |
commit | 1a9b8a58c7e01f0926e51b39b7b37f932537cc0c (patch) | |
tree | db9ef99cb0a4aa048a7aa439b629b13cb6d182f6 /ale_linters/java | |
parent | 092748caacfe720835e7c7efc934ffa5e70ccc5d (diff) | |
parent | 5a8ba7526532f8bd6dde93764cccc5277d568349 (diff) | |
download | ale-1a9b8a58c7e01f0926e51b39b7b37f932537cc0c.zip |
Merge pull request #2520 from hsanson/fix-eclipselsp-workspace-config
Fix eclipselsp workspace config
Diffstat (limited to 'ale_linters/java')
-rw-r--r-- | ale_linters/java/eclipselsp.vim | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/ale_linters/java/eclipselsp.vim b/ale_linters/java/eclipselsp.vim index c0b476a3..2648893b 100644 --- a/ale_linters/java/eclipselsp.vim +++ b/ale_linters/java/eclipselsp.vim @@ -5,6 +5,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_workspace_path', '') call ale#Set('java_eclipselsp_executable', 'java') function! ale_linters#java#eclipselsp#Executable(buffer) abort @@ -89,6 +90,16 @@ function! ale_linters#java#eclipselsp#CommandWithVersion(buffer, version_lines, return ale_linters#java#eclipselsp#Command(a:buffer, l:version) endfunction +function! ale_linters#java#eclipselsp#WorkspacePath(buffer) abort + let l:wspath = ale#Var(a:buffer, 'java_eclipselsp_workspace_path') + + if !empty(l:wspath) + return l:wspath + endif + + return ale#path#Dirname(ale#java#FindProjectRoot(a:buffer)) +endfunction + function! ale_linters#java#eclipselsp#Command(buffer, version) abort let l:path = ale#Var(a:buffer, 'java_eclipselsp_path') @@ -102,11 +113,11 @@ function! ale_linters#java#eclipselsp#Command(buffer, version) abort \ '-noverify', \ '-Xmx1G', \ '-jar', - \ ale_linters#java#eclipselsp#JarPath(a:buffer), + \ ale#Escape(ale_linters#java#eclipselsp#JarPath(a:buffer)), \ '-configuration', - \ ale_linters#java#eclipselsp#ConfigurationPath(a:buffer), + \ ale#Escape(ale_linters#java#eclipselsp#ConfigurationPath(a:buffer)), \ '-data', - \ ale#java#FindProjectRoot(a:buffer) + \ ale#Escape(ale_linters#java#eclipselsp#WorkspacePath(a:buffer)) \ ] if ale#semver#GTE(a:version, [1, 9]) |