Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [lsp4e-dev] Documentation request: Using LSP4E or LSP4J with non-Java servers

Thanks Nathan,

I will look at the example. I am familiar with clang and clangd. And I have been able to start a language server using the Preferences dialog that provides the MIME and extension mapping.

I still think that explicit documentation to this end would be very helpful.

Best wishes,

JG

On Thu, 25 Feb 2021 at 14:15, Nathan Ridge <zeratul976@xxxxxxxxxxx> wrote:
Hi Jörn,

I think the confusion here may stem from the fact that LSP4J can serve as the basis for a language *server* written in Java, as well as a language *client* written in Java (and LSP4E more specifically for an Eclipse-based client written in Java). However, there is no requirement that the client and server are written in the same language (or indeed that they share anything at all beyond speaking the same protocol).

Eclipse CDT is an example of an Eclipse project which has an LSP client built on LSP4E (albeit not one it uses by default) and which talks to a server written in a different language (clangd, written in (and for) C++). Perhaps looking at its sources [1] would be helpful for you.

Regards,
Nate

[1] https://git.eclipse.org/c/cdt/org.eclipse.cdt.git/tree/lsp

________________________________________
From: lsp4e-dev <lsp4e-dev-bounces@xxxxxxxxxxx> on behalf of Jörn Guy Süß <jgsuess@xxxxxxxxx>
Sent: February 24, 2021 10:02 PM
To: lsp4e-dev@xxxxxxxxxxx
Subject: [lsp4e-dev] Documentation request: Using LSP4E or LSP4J with non-Java servers

Hello!

We (codebots.com<http://codebots.com>) would like to create a headless client in Java that responds to changes in different pre-existing language servers that are not implemented in Java. The client will be embedded in an Eclipse plugin that runs headless.

We are looking at this list of servers, and aim to instantiate many of them: https://langserver.org/#implementations-server

We are aware of the instructions to start a language server like lsp4j (https://github.com/eclipse/eclipse.jdt.ls#user-content-running-from-the-command-line), and of the need to Implement the Language Server interface (https://github.com/eclipse/lsp4j/blob/master/documentation/README.md#user-content-implement-your-language-server), but we have not found any guidance on how this should be done for an existing server.

Given that language servers are meant to be separate processes intended to abstract from underlying concrete languages semantics, we believe that the org.eclipse.lsp4j.services.LanguageServer implementation has to be responsible for starting the server and marshalling data for the server. But from the examples it is not obvious how an existing server needs to be exposed. All examples seem to assume that the server is implemented in the host language.

Our lack of understanding of existing servers is a blocker for us to adopt the technology. It would be great if there was documentation to describe how this is done.

Assuming reuse is possible, we are also interested in understanding which aspects of LSP4E we can reuse for our headless application, given that most exposed extension points are concerning UI events that probably require widgets to be present.

We are posting this question to the developers list, as we believe that this is an important question regarding existing documentation.

If the answer is that cross-languages reuse of LSP servers is not possible, then we feel this should be clearly stated, as this would imply a substantial limitation of the technology.

Best wishes,

Jörn Guy Süß

_______________________________________________
lsp4e-dev mailing list
lsp4e-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/lsp4e-dev


--

730 Hawkesbury Road
Anstead, QLD 4070
Australia
 

email: jgsuess@xxxxxxxxx


Back to the top