Skip to content

Developer Manual Integrate Language Server Into Client

Martin Lippert edited this page Jan 10, 2021 · 1 revision

This page contains useful information for integrating the Spring Boot language server into another client that supports the language server protocol.

(most of this has been discussed here: https://github.com/spring-projects/sts4/issues/76, as a reference)

Where to get the released language server JAR file from?

We plan to publish the language server itself as a standard Maven artifact in the future, but that hasn't been done yet. So the easiest way to grab the latest version of the Spring Boot language server is to download the .vsix file of the Spring Boot Tools extension for Visual Studio Code (there is a link on the VSCode marketplace entry to download the extension in the Resources section). Once you have the .vsix file, you can extract it (it is a ZIP file) and find the spring-boot-language-server JAR file inside.

Where to get the JDT-LS extension bundle from?

Same as above.

VM options recommendations for launching the server

Here are the options we use for launching the Spring Boot language server:

Supported Protocol API (version and methods)

tbd

Command line arguments, if any

tbd

Protocol debugging facilities

You have two options if you want to debug the Spring Boot language server.

  • you can modify the startup params to include the JVM debug options and create a remote debug connection to it from your favorite IDE. This is easy, but it isn't super useful if you want to modify the language server itself.
  • you can launch the Spring Boot language server as a standard Java process from within your IDE (as any other Java process) and debug it from there. When doing so, you would need to start it up with a specific param to invert the process the client connects to the language server (so the client needs to allow this kind of creating a connection).

(more details tbd)

Relation/dependencies on a Java language server

The Spring Boot language server depends on the JDT language server to be around and running. The language server communicates with the JDT-LS in order to resolve projects and get classpath information, search for java types and packages, and similar things.

The setup for this communication is described in more detail here: https://github.com/spring-projects/sts4/issues/76#issuecomment-427074764

Relation/dependencies on build systems (Maven, Gradle)

The Spring Boot language server does not depend on any specific build system available at runtime. It communicates with the JDT-LS in order to get classpath information, etc. Therefore it usually does not build projects on its own or resolve the classpath on its own.

There is a deprecated mechanism included in the Spring Boot language server that uses Maven or Gradle directly to resolve project/classpath information, but that mechanism will be removed in the near future and users of the Spring Boot language server should not rely on that fallback mechanism to be there.

Clone this wiki locally