moved language server system property set call to main method to have that happening as early as possible in the JVM lifetime

This commit is contained in:
Martin Lippert
2019-05-03 17:43:54 +02:00
parent db780c0479
commit 28c0637395
6 changed files with 18 additions and 26 deletions

View File

@@ -38,6 +38,7 @@ import org.springframework.ide.vscode.boot.metadata.ProjectBasedPropertyIndexPro
import org.springframework.ide.vscode.boot.metadata.PropertyInfo;
import org.springframework.ide.vscode.boot.metadata.ValueProviderRegistry;
import org.springframework.ide.vscode.boot.yaml.completions.ApplicationYamlAssistContext;
import org.springframework.ide.vscode.commons.languageserver.LanguageServerRunner;
import org.springframework.ide.vscode.commons.languageserver.util.DocumentEventListenerManager;
import org.springframework.ide.vscode.commons.languageserver.util.LspClient;
import org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguageServer;
@@ -56,17 +57,16 @@ import org.yaml.snakeyaml.Yaml;
@SpringBootApplication(proxyBeanMethods = false)
public class BootLanguagServerBootApp {
private static final String SERVER_NAME = "boot-language-server";
public static void main(String[] args) throws Exception {
System.setProperty(LanguageServerRunner.SYSPROP_LANGUAGESERVER_NAME, SERVER_NAME); //makes it easy to recognize language server processes - and set this as early as possible
LogRedirect.bootRedirectToFile(SERVER_NAME); //TODO: use boot (or logback realy) to configure logging instead.
SpringApplication.run(BootLanguagServerBootApp.class, args);
}
@Bean public String serverName() {
return SERVER_NAME;
}
@ConditionalOnMissingClass("org.springframework.ide.vscode.languageserver.testharness.LanguageServerHarness")
@Bean
SymbolCache symbolCache(BootLsConfigProperties props) {