#Ballerina LSP executable

1 messages · Page 1 of 1 (latest)

inland crow
#

Hi all,

I'm trying to use a different editor with Ballerina, and would like to use the LSP with it. It is unclear to me from the documentation here (https://github.com/ballerina-platform/ballerina-lang/tree/master/language-server) how I should go about achieving that.

Is the suggested workflow for me to build a language server executable from the java source in the repo linked above and use that, or is it published as an artifact somewhere?

GitHub

The Ballerina Programming Language. Contribute to ballerina-platform/ballerina-lang development by creating an account on GitHub.

trim escarp
#

LSP requires two entities: A language server and a language client. The LSP Language Server(LS) implementation for Ballerina is included in the Ballerina distribution(https://ballerina.io/downloads/). According to the LSP(https://microsoft.github.io/language-server-protocol/overviews/lsp/overview/), there should be a separate LSP language client for each editor. Atm, we only have a language client for VSCode in the form of Ballerina VSCode extension. It has a LSP language client which communicates with the Ballerina LS.
Therefore, you have to develop a new Language Client (extension) for the desired editor to use the Ballerina LS there.

The Ballerina LS is not published as a separate artifact. However, ballerina-lang can be built from source as specified in https://github.com/ballerina-platform/ballerina-distribution/blob/master/docs/build-ballerina-from-source.md. You can use the resulting jar to invoke the Ballerina LS from the the developed Language Client. I am happy to help if you need more information on how to develop a Language Client.

inland crow
#

Thanks Malintha! I was trying to use it with neovim's LS extension (https://github.com/neovim/nvim-lspconfig), but don't have bandwidth to put into this right now... Will reach out when I get back to it!

limpid knot
inland crow