Make language server processes easy to recognize

Set a system property 'sts4.languageserver.name'. This serves as an easy 
marker to recognize language servers.
This commit is contained in:
Kris De Volder
2017-10-20 15:03:28 -07:00
parent 1f73e46f4f
commit 9983f6c8c4
6 changed files with 7 additions and 7 deletions

View File

@@ -25,7 +25,7 @@ import org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguage
public class Main {
public static void main(String[] args) throws IOException, InterruptedException {
LaunguageServerApp.start(() -> {
LaunguageServerApp.start("boot-java", () -> {
CompositeJavaProjectFinder javaProjectFinder = new CompositeJavaProjectFinder();
DefaultSpringPropertyIndexProvider indexProvider = new DefaultSpringPropertyIndexProvider(javaProjectFinder);

View File

@@ -31,7 +31,7 @@ import org.springframework.ide.vscode.commons.util.text.IDocument;
public class Main {
public static void main(String[] args) throws IOException, InterruptedException {
LaunguageServerApp.start(() -> {
LaunguageServerApp.start("boot-properties", () -> {
CompositeJavaProjectFinder javaProjectFinder = new CompositeJavaProjectFinder();
DefaultSpringPropertyIndexProvider indexProvider = new DefaultSpringPropertyIndexProvider(javaProjectFinder);
TypeUtilProvider typeUtilProvider = (IDocument doc) -> new TypeUtil(javaProjectFinder.find(new TextDocumentIdentifier(doc.getUri())));

View File

@@ -20,7 +20,7 @@ import org.springframework.ide.vscode.commons.languageserver.LaunguageServerApp;
public class Main {
public static void main(String[] args) throws IOException, InterruptedException {
BoshCliConfig cliConfig = new BoshCliConfig();
LaunguageServerApp.start(() -> new BoshLanguageServer(
LaunguageServerApp.start("bosh", () -> new BoshLanguageServer(
cliConfig,
new BoshCommandCloudConfigProvider(cliConfig),
new BoshCommandStemcellsProvider(cliConfig),

View File

@@ -59,7 +59,8 @@ public abstract class LaunguageServerApp {
private static final String STANDALONE_STARTUP = "standalone-startup";
private static final int SERVER_STANDALONE_PORT = 5007;
public static void start(Provider<SimpleLanguageServer> languageServerFactory) throws IOException, InterruptedException {
public static void start(String name, Provider<SimpleLanguageServer> languageServerFactory) throws IOException, InterruptedException {
System.setProperty("sts4.languageserver.name", name); //makes it easy to recognize language server processes.
LaunguageServerApp app = new LaunguageServerApp() {
@Override
protected SimpleLanguageServer createServer() {
@@ -252,5 +253,4 @@ public abstract class LaunguageServerApp {
protected abstract SimpleLanguageServer createServer();
}

View File

@@ -20,6 +20,6 @@ public class Main {
private static final YamlCompletionEngineOptions OPTIONS = YamlCompletionEngineOptions.DEFAULT;
public static void main(String[] args) throws IOException, InterruptedException {
LaunguageServerApp.start(() -> new ConcourseLanguageServer(OPTIONS));
LaunguageServerApp.start("concourse", () -> new ConcourseLanguageServer(OPTIONS));
}
}

View File

@@ -28,7 +28,7 @@ public class Main {
logfile = new File(System.getProperty("org.slf4j.simpleLogger.logFile"));
}
System.err.println("Redirecting log output to: "+logfile);
LaunguageServerApp.start(ManifestYamlLanguageServer::new);
LaunguageServerApp.start("cloudfoundry", ManifestYamlLanguageServer::new);
}
}