Search in sources :

Example 1 with LanguageServerLauncher

use of org.eclipse.che.api.languageserver.launcher.LanguageServerLauncher in project che by eclipse.

the class LanguageServerRegistryImpl method findServer.

@Nullable
protected LanguageServer findServer(String extension, String projectPath) throws LanguageServerException {
    ProjectExtensionKey projectKey = createProjectKey(projectPath, extension);
    for (LanguageServerLauncher launcher : extensionToLauncher.get(extension)) {
        if (!projectToServer.containsKey(projectKey)) {
            synchronized (launcher) {
                if (!projectToServer.containsKey(projectKey)) {
                    LanguageServer server = initializer.initialize(launcher, projectPath);
                    projectToServer.put(projectKey, server);
                }
            }
        }
        return projectToServer.get(projectKey);
    }
    return null;
}
Also used : LanguageServer(io.typefox.lsapi.services.LanguageServer) ProjectExtensionKey(org.eclipse.che.api.languageserver.shared.ProjectExtensionKey) LanguageServerLauncher(org.eclipse.che.api.languageserver.launcher.LanguageServerLauncher) Nullable(org.eclipse.che.commons.annotation.Nullable)

Aggregations

LanguageServer (io.typefox.lsapi.services.LanguageServer)1 LanguageServerLauncher (org.eclipse.che.api.languageserver.launcher.LanguageServerLauncher)1 ProjectExtensionKey (org.eclipse.che.api.languageserver.shared.ProjectExtensionKey)1 Nullable (org.eclipse.che.commons.annotation.Nullable)1