THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
- Download the LSP implementation for the language you wish to add support for. See a list of Language Server implementations and another list of Language Server Implementations.For example, to add support for Kotlin programming language, download and build kotlin-language-server.
- Add the following module dependencies to your module, as described in the previous chapter: "LSP Client" and "MIME Lookup API".
- Create a new class that implements
LanguageServerProvider
.
See for example, ShellClient
or java/kotlin.editor/src/org/netbeans/modules/kotlin/editor/
lsp/KotlinLSPServer
. E.g. for Kotlin, you will need to provide the path to kotlin-language-server/server/build/install/server/bin/kotlin-language-server
inside the overriden startServer()
method of this class:
public class KotlinLSPServer implements LanguageServerProvider {
private static final Logger LOG = Logger.getLogger(KotlinLSPServer.class.getName());
@Override
public LanguageServerDescription startServer(Lookup lookup) {
File server = new File("kotlin-language-server/server/build/install/server/bin/kotlin-language-server");
try {
return LanguageServerDescription.create(p.getInputStream(), p.getOutputStream(), p);
} catch (IOException ex) {
LOG.log(Level.FINE, null, ex);
return null;
}
}
}
Important note! It is yet to be decided where to install and how to access the (pre-)built language servers.
...