Fix eclipse.jdt.ls workspace data path.

We were setting the -data parameter to the project root but this caused
the language server to fail initialization and synch of gradle
dependencies. As consequence ALE failed to work fully on gradle
projects.

This fix sets the workspace to the parent folder of the project root.
Normally this corresponds to the correct Eclipse workspace path.

When this is not the case, this fix also allows users to explicitly set
the absolute path to the workspace via configuration variable.
This commit is contained in:
Horacio Sanson
2019-05-21 13:33:47 +09:00
parent 67d49c75a8
commit 5a8ba75265
3 changed files with 36 additions and 13 deletions

View File

@@ -61,11 +61,11 @@ Execute(The eclipselsp callback should return the correct default value):
\ '-noverify',
\ '-Xmx1G',
\ '-jar',
\ '',
\ ale#Escape(''),
\ '-configuration',
\ b:cfg,
\ ale#Escape(b:cfg),
\ '-data',
\ ''
\ ale#Escape(ale#path#Simplify(''))
\]
AssertLinter 'java', join(cmd, ' ')
@@ -79,11 +79,11 @@ Execute(The eclipselsp callback should allow custom executable):
\ '-noverify',
\ '-Xmx1G',
\ '-jar',
\ '',
\ ale#Escape(''),
\ '-configuration',
\ b:cfg,
\ ale#Escape(b:cfg),
\ '-data',
\ ''
\ ale#Escape(ale#path#Simplify(''))
\]
AssertLinter '/bin/foobar', join(cmd, ' ')
@@ -97,10 +97,10 @@ Execute(The eclipselsp callback should allow custom configuration path):
\ '-noverify',
\ '-Xmx1G',
\ '-jar',
\ '',
\ ale#Escape(''),
\ '-configuration',
\ ale#path#Simplify('/home/config'),
\ ale#Escape(ale#path#Simplify('/home/config')),
\ '-data',
\ ''
\ ale#Escape(ale#path#Simplify(''))
\]
AssertLinter 'java', join(cmd, ' ')