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
Provide a Java process command builder. #833
Conversation
Signed-off-by: azerr <azerr@redhat.com>
I find there is almost always a few things, like a system property, a Java version, some classpath, some other configuration file... to look at that make that there is no strong benefit in having such rationalization here. For instance, inLemMinX, we wouldn't use it as you mention it has some extension to contribute to classpath and those extensions wouldn't necessary make sense for other Java-process-based language servers. |
And as I tried to explain, for override classpath, I think LSP4E should integrate the M2E extension point which override classpaths and builder could use it, It will avoid coding https://github.com/eclipse-wildwebdeveloper/wildwebdeveloper/blob/92ece9fc35e4e028eb249cacf445512bbafac835/org.eclipse.wildwebdeveloper.xml/src/org/eclipse/wildwebdeveloper/xml/internal/XMLLanguageServer.java#L169 and another LS (like Quarkus could benefit with this extension point) I mean that builder will use this extension point to prefill classpath. The builder create a standard command list but you can add another command if you wish. |
I disagree here: the way to extend a Java-based process can differ from a Java process to another. The problem of how to best start a Java LS is not so generic, and the how to extend it is even less. I'm not under the impression that the problems are really generic and hard to solve with existing API, so I'm not convinced LSP4E should try to go further/more specific here. |
What is the status of this one ? |
IMHO I think it can be a good idea to have that. We provide that in LSP4IJ an dit is very helpfull. For instance you don't need to take care of generation of debug string command. In LSP4IJ we have a generic debug port and suspend fields and the Java builder generate the proper command (no need to write a custom UI to fill debugging info for Java process). The Java builder from LSP4IJ will provide an extension point to add some JAR in classpath which is very helpfull too. I tried to convince LSP4E to adopt this idea by giving concrete sample like WWD for staring lemminx, Qute LS, MicroProfile LS, etc All those language server have the same code. |
The initial target branch |
This PR provides the capability to build a Java process command with a builder to start a language server written in Java. The advantage of this builder is:
This builder could simplify code:
As you can notice the code is the same (ex : computeJavaPath), etc