flathub / org.freedesktop.Sdk.Extension.openjdk

12 stars 15 forks source link

Language Server Support #16

Open chergert opened 2 years ago

chergert commented 2 years ago

This is a bit of a strawman issue, hoping to get some buy-in from openjdk SDK maintainers.

I wrote/maintain GNOME Builder and I'm trying to extend the reach of our out-of-the-box IDE support for more languages. Currently, we have support for jdtls, but it would be much more effective for applications that are to be shipped as flatpak's if the language server was bundled as part of the SDK (as we do for many other org.freedesktop.Sdk.Extension.* runtimes).

That would allow builder to run jdtls (or any other LSP if there is a better choice in the Java eco-system) within the build environment/container/toolbox/etc ensuring more correct completion results and what not.

Thoughts?

tsmock commented 2 months ago

@chergert : let me know if what I've done in #74 will work for you.

chergert commented 2 months ago

I think it makes sense from my PoV. We just would need to make sure that applications using it will have the sdk-extension set and an appropriate append-path, then we'll just pick it up in GNOME Builder. Though currently we expect it to be jdtls (but we can change that if necessary).

tsmock commented 2 months ago

What do you expect jdtls to be? As in, is it a shell script with "known-good" start variables, or do you have to add additional arguments when starting it?

chergert commented 2 months ago

Yeah it can be a shell script wrapper and that is fine. It just needs to do the LSP communication over stdin/stdout like most language servers. So be wary of any sort of printf/echo in any wrapper scripts.

We generally start the language server from the build directory (or maybe source directory, not sure) so it can pick up all the project build/configuration/etc.

Also, a symlink to the language server is fine too (assuming it is executable).