-
Notifications
You must be signed in to change notification settings - Fork 116
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
Run LemMinX-Maven LS in the same Java process? #902
Comments
See
The lemminx Editor makes it really hard to edit pom files and copy+paste with shortcuts is simply unusable as it is completely random what part is copied/inserted ... So if we can improve this by runin it it inline that would be good, still I would expect that connecting to "localhost" would be equally fast if we are not transferring hundreds of megabytes of data ... |
That's how we 1st tried this language-server integration story, but it had tons of drawbacks for very low functional value:
So IMO, it's really not a sustainable path to follow.
This is usually not the result of a connection issue, but some bug in the underlying language server that becomes stuck and doesn't answer.
The connection doesn't change anything visible indeed. The issue you've mentioned are internal to lemminx-maven and would still happen if the LS was started in any different deployment. |
You can embed an OSGi Framework inside a running one to get a (mostly) isolated environment, and such an uber-jar can actually be a OSGi bundle that has nothing more than an activator that starts the "main" and open the TCP port as if this where an own process. So I think all those drawbacks are more a matter of how one actually embeds the thing.
It would be good if I can enable some kind of logging to capture useful information, so embedding might improve at least the ability to use the same error log and tracing facilities than the running host. |
I regularly encounter similar issues. I'm not familiar with the details but what Christoph suggested is similar to what I had in mind to, why not simply run the entire language server in the same VM? Maybe this gives better error messages and simplifies debugging? In general the whole language server and Editor story is a bit fragment to me and I'm not sure I fully understand it.
All that runs in the LS-Server VM at the moment? And is wildwebdeveloper also involved? At least M2E has dependencies on that and IIRC it is also in the area of editors. Is there any document that describes the story as a whole to get a overview about that? |
It's not "simply", it's not even "simpler" and it wouldn't bring better performance, nor better quality nor better maintainability over a separate process. Wild Web Developer provides the XML Language Server (LemMinX) integration, building the process. LemMinX is extensible, lemminx-maven is 1 extension. m2e does declare the extension for lemminx to wild web developer. But really, the beauty here is that the deployment doesn't really matter and we can go for the simplest (a process) and get the same final quality as if we had a very smart deployment. |
OK we then don't gain anything by running the server in the same VM. Thank you for your elaboration and I will try to debug the issues if I encounter them the next time and can then hopefully provide some useful information. |
With the recent discussion in #848, I think it is worth to think about this again as a way to improve the integration of the LSP in m2e and to reduce doubled resource usages. @mickaelistria IIRC in the Eclipse IDE 2023-06 Webinar you mentioned that the the JDT-LS is running in the same process as the IDE, which allows to tighten the integration between JDT and the LS by share states? Wouldn't the benefits for JDT-LS also apply to m2e? |
JDT LS is a headless Eclipse RCP application (it's actually JDT-Core and deps + 1 extra bundle), it's OSGi-ready in 1st place and runs well in the same OSGi container and other Eclipse plugins. It actually easier to run it in the same process OSGi container than to run it in different process. |
@mickaelistria you mentioned that it is possible to launch the Language-Server in the same Java process:
https://www.eclipse.org/lists/platform-dev/msg03696.html
I wonder if that would be beneficial for M2E as well? On my Windows-Computer M2E occasionally fails to connect to the LS-server or ends with time-out errors. I have not yet investigated that further, but could the connection become more robust when the LS-server runs in the same VM?
The text was updated successfully, but these errors were encountered: