Add some logging to see startup times
This commit is contained in:
@@ -14,6 +14,7 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.PrintStream;
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Socket;
|
||||
import java.net.SocketAddress;
|
||||
@@ -86,6 +87,7 @@ public class LanguageServerRunner implements CommandLineRunner {
|
||||
public void start() throws Exception {
|
||||
System.setProperty(SYSPROP_LANGUAGESERVER_NAME, name); //makes it easy to recognize language server processes.
|
||||
LanguageServerRunner app = this;
|
||||
log.info("Server ready to start after {} ms", ManagementFactory.getRuntimeMXBean().getUptime());
|
||||
if (properties.isStandalone()) {
|
||||
app.startAsServer();
|
||||
} else {
|
||||
|
||||
@@ -12,6 +12,7 @@ package org.springframework.ide.vscode.commons.languageserver.util;
|
||||
|
||||
import static org.springframework.ide.vscode.commons.util.AsyncRunner.thenLog;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.net.URI;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
@@ -218,7 +219,7 @@ public final class SimpleLanguageServer implements Sts4LanguageServer, LanguageC
|
||||
|
||||
@Override
|
||||
public CompletableFuture<InitializeResult> initialize(InitializeParams params) {
|
||||
log.debug("Initializing: "+params);
|
||||
log.info("Initializing");
|
||||
|
||||
// multi-root workspace handling
|
||||
List<WorkspaceFolder> workspaceFolders = getWorkspaceFolders(params);
|
||||
@@ -273,6 +274,7 @@ public final class SimpleLanguageServer implements Sts4LanguageServer, LanguageC
|
||||
RegistrationParams registrationParams = new RegistrationParams(Collections.singletonList(registration));
|
||||
getClient().registerCapability(registrationParams);
|
||||
this.initialized.complete(null); // triggers onInitialized handlers.
|
||||
log.info("Initialization completed after {} ms", ManagementFactory.getRuntimeMXBean().getUptime());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user