use of org.eclipse.xtext.ide.server.LanguageServerImpl in project smarthome by eclipse.
the class ModelServer method handleConnection.
private void handleConnection(final Socket client) {
logger.debug("Client {} connected", client.getRemoteSocketAddress());
try {
LanguageServerImpl languageServer = injector.getInstance(LanguageServerImpl.class);
Launcher<LanguageClient> launcher = LSPLauncher.createServerLauncher(languageServer, client.getInputStream(), client.getOutputStream());
languageServer.connect(launcher.getRemoteProxy());
Future<?> future = launcher.startListening();
future.get();
} catch (IOException e) {
logger.warn("Error communicating with LSP client {}", client.getRemoteSocketAddress());
} catch (InterruptedException e) {
// go on, let the thread finish
} catch (ExecutionException e) {
logger.error("Error running the Language Server", e);
}
logger.debug("Client {} disconnected", client.getRemoteSocketAddress());
}
Aggregations