Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix javalsp command callback. #2558

Merged
merged 2 commits into from
Jun 10, 2019

Conversation

hsanson
Copy link
Contributor

@hsanson hsanson commented Jun 4, 2019

The command used to invoke the language server is missing some options
to include additional java modules. Without these modules the server
was not working properly.

The correct command can be found in a launcher script on the same
directory the java executable for the language server is found.

This commit changes the docs to prefer the launcher script over the java
executable. For backward compatibility it also fixes the command
invocation in case the java executable is configured.

The command used to invoke the language server is missing some options
to include additional java modules. Without these modules the server
was not working properly.

The correct command can be found in a `launcher` script on the same
directory the `java` executable for the language server is found.

This commit changes the docs to prefer the launcher script over the java
executable. For backward compatibility it also fixes the command
invocation in case the java executable is configured.
Copy link
Member

@w0rp w0rp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think launcher is probably an executable name that's too generic and might cause other programs to be run. Is there a set of locations where the launcher script is likely to be installed, say in your HOME directory? It might be a better idea to look for the language server script in those directories first, and fall back on launching the language server with java if the script cannot be found.

@w0rp w0rp added this to In Review in Old Working List via automation Jun 8, 2019
@w0rp w0rp mentioned this pull request Jun 8, 2019
The default binary "launcher" is too generic and can get mixed with
other tools. To use this linter user must explicitly set the absolute
path of the launcher path.
@hsanson
Copy link
Contributor Author

hsanson commented Jun 9, 2019

@w0rp I thought about this for a while and cannot really find a way to prevent getting the wrong binary . The only solution I can see is to force users to explicitly set a value for g:ale_java_javalsp_executable.

When installing the java-language-server manually there is no pre-defined location so it can be anywhere on the users home dir and when installing it via VSCode plugin there is no binary at all. Not sure how vscode invokes the language server.

Falling back to java is not good either. it must be the java binary generated when compiling the language server. It cannot be the system installed java. Therefore, this also must be explicitly set to the absolute path of the language server provided binaries.

Copy link
Member

@w0rp w0rp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fine.

@w0rp w0rp merged commit 1ba1a9e into dense-analysis:master Jun 10, 2019
Old Working List automation moved this from In Review to Done Jun 10, 2019
@w0rp
Copy link
Member

w0rp commented Jun 10, 2019

Cheers! 🍻

@hsanson hsanson deleted the fix-javalsp-command-callback branch June 10, 2019 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants