forked from hkolvenbach/che
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Several improvements to the way remote language servers may be config…
…ured through workspace configuration (eclipse-che#9387)
- Loading branch information
Dmytro Kulieshov
authored and
hbhargav
committed
Dec 4, 2018
1 parent
306a083
commit bb0b4a7
Showing
147 changed files
with
5,041 additions
and
5,466 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
...in/java/org/eclipse/che/plugin/camel/server/languageserver/CamelLanguageServerConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* | ||
* Copyright (c) 2012-2018 Red Hat, Inc. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
*/ | ||
package org.eclipse.che.plugin.camel.server.languageserver; | ||
|
||
import com.google.common.collect.ImmutableMap; | ||
import com.google.common.collect.ImmutableSet; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import java.util.Map; | ||
import java.util.Set; | ||
import javax.inject.Inject; | ||
import javax.inject.Singleton; | ||
import org.eclipse.che.api.languageserver.DefaultInstanceProvider; | ||
import org.eclipse.che.api.languageserver.LanguageServerConfig; | ||
import org.eclipse.che.api.languageserver.ProcessCommunicationProvider; | ||
import org.eclipse.che.plugin.camel.server.inject.CamelModule; | ||
|
||
/** Launcher for Apache Camel Language Server */ | ||
@Singleton | ||
public class CamelLanguageServerConfig implements LanguageServerConfig { | ||
private static final String REGEX = ".*\\.(xml)"; | ||
|
||
private final Path launchScript; | ||
|
||
@Inject | ||
public CamelLanguageServerConfig() { | ||
|
||
this.launchScript = Paths.get(System.getenv("HOME"), "che/ls-camel/launch.sh"); | ||
} | ||
|
||
@Override | ||
public RegexProvider getRegexpProvider() { | ||
return new RegexProvider() { | ||
@Override | ||
public Map<String, String> getLanguageRegexes() { | ||
return ImmutableMap.of(CamelModule.LANGUAGE_ID, REGEX); | ||
} | ||
|
||
@Override | ||
public Set<String> getFileWatchPatterns() { | ||
return ImmutableSet.of(); | ||
} | ||
}; | ||
} | ||
|
||
@Override | ||
public CommunicationProvider getCommunicationProvider() { | ||
ProcessBuilder processBuilder = new ProcessBuilder(launchScript.toString()); | ||
processBuilder.redirectInput(ProcessBuilder.Redirect.PIPE); | ||
processBuilder.redirectOutput(ProcessBuilder.Redirect.PIPE); | ||
|
||
return new ProcessCommunicationProvider(processBuilder, CamelModule.LANGUAGE_ID); | ||
} | ||
|
||
@Override | ||
public InstanceProvider getInstanceProvider() { | ||
return DefaultInstanceProvider.getInstance(); | ||
} | ||
|
||
@Override | ||
public InstallerStatusProvider getInstallerStatusProvider() { | ||
return new InstallerStatusProvider() { | ||
@Override | ||
public boolean isSuccessfullyInstalled() { | ||
return launchScript.toFile().exists(); | ||
} | ||
|
||
@Override | ||
public String getCause() { | ||
return isSuccessfullyInstalled() ? null : "Launch script file does not exist"; | ||
} | ||
}; | ||
} | ||
} |
105 changes: 0 additions & 105 deletions
105
.../java/org/eclipse/che/plugin/camel/server/languageserver/CamelLanguageServerLauncher.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.