use of io.typefox.lsapi.impl.InitializeParamsImpl in project che by eclipse.
the class ServerInitializerImpl method prepareInitializeParams.
protected InitializeParamsImpl prepareInitializeParams(String projectPath) {
InitializeParamsImpl initializeParams = new InitializeParamsImpl();
initializeParams.setProcessId(PROCESS_ID);
initializeParams.setRootPath(projectPath);
initializeParams.setCapabilities(new ClientCapabilitiesImpl());
initializeParams.setClientName(CLIENT_NAME);
return initializeParams;
}
use of io.typefox.lsapi.impl.InitializeParamsImpl in project che by eclipse.
the class ServerInitializerImpl method doInitialize.
protected LanguageServer doInitialize(LanguageServerLauncher launcher, String projectPath) throws LanguageServerException {
String languageId = launcher.getLanguageDescription().getLanguageId();
InitializeParamsImpl initializeParams = prepareInitializeParams(projectPath);
LanguageServer server;
try {
server = launcher.launch(projectPath);
} catch (LanguageServerException e) {
throw new LanguageServerException("Can't initialize Language Server " + languageId + " on " + projectPath + ". " + e.getMessage(), e);
}
registerCallbacks(server);
CompletableFuture<InitializeResult> completableFuture = server.initialize(initializeParams);
try {
InitializeResult initializeResult = completableFuture.get();
serversToInitResult.put(server, new LanguageServerDescription(initializeResult, launcher.getLanguageDescription()));
} catch (InterruptedException | ExecutionException e) {
server.shutdown();
server.exit();
throw new LanguageServerException("Error fetching server capabilities " + languageId + ". " + e.getMessage(), e);
}
LOG.info("Initialized Language Server {} on project {}", languageId, projectPath);
return server;
}
Aggregations