Attempt to fix hanging tests. Logging.
This commit is contained in:
@@ -26,6 +26,8 @@ import org.eclipse.lsp4j.CodeActionKind;
|
||||
import org.eclipse.lsp4j.CodeActionOptions;
|
||||
import org.eclipse.lsp4j.InitializeParams;
|
||||
import org.eclipse.lsp4j.ServerCapabilities;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
@@ -126,6 +128,8 @@ import reactor.core.publisher.Hooks;
|
||||
public class BootLanguageServerBootApp {
|
||||
|
||||
private static final String SERVER_NAME = "boot-language-server";
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(BootLanguageServerBootApp.class);
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
Hooks.onOperatorDebug();
|
||||
@@ -392,6 +396,7 @@ public class BootLanguageServerBootApp {
|
||||
scheduleValidation(project);
|
||||
}
|
||||
});
|
||||
log.info("Started Boot Version reconciler");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -142,7 +142,8 @@ public class BootLanguageServerInitializer implements InitializingBean {
|
||||
|
||||
components.getDocumentSymbolProvider().ifPresent(documents::onDocumentSymbol);
|
||||
|
||||
server.doOnInitialized(() -> {
|
||||
// TODO: seems to hang tests if done on server initialize. Test Harness Server is likely to be initialized already by this point
|
||||
// server.doOnInitialized(() -> {
|
||||
if (recipesRepo != null) {
|
||||
recipesRepo.onRecipesLoaded(v -> {
|
||||
// Recipes will start loading only after config has been received. Therefore safe to start listening to config changes now
|
||||
@@ -155,7 +156,7 @@ public class BootLanguageServerInitializer implements InitializingBean {
|
||||
startListeningToPerformReconcile();
|
||||
reconcile();
|
||||
}
|
||||
});
|
||||
// });
|
||||
|
||||
server.onShutdown(() -> {
|
||||
for (TextDocument d : documents.getAll()) {
|
||||
|
||||
@@ -16,6 +16,8 @@ import java.nio.file.Paths;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.lsp4j.TextDocumentIdentifier;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.ide.vscode.boot.app.BootJavaConfig;
|
||||
import org.springframework.ide.vscode.boot.common.IJavaProjectReconcileEngine;
|
||||
import org.springframework.ide.vscode.boot.common.ProjectReconcileScheduler;
|
||||
@@ -28,6 +30,8 @@ import org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguage
|
||||
import org.springframework.ide.vscode.commons.util.text.TextDocument;
|
||||
|
||||
public class BootJavaProjectReconcilerScheduler extends ProjectReconcileScheduler {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(BootJavaProjectReconcilerScheduler.class);
|
||||
|
||||
private static final List<String> FILES_TO_WATCH_GLOB = List.of("**/*.java");
|
||||
|
||||
@@ -45,6 +49,7 @@ public class BootJavaProjectReconcilerScheduler extends ProjectReconcileSchedule
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
log.info("Starting project reconciler for Java sources");
|
||||
super.init();
|
||||
if (recipesRepo != null) {
|
||||
recipesRepo.onRecipesLoaded(v -> {
|
||||
@@ -52,10 +57,12 @@ public class BootJavaProjectReconcilerScheduler extends ProjectReconcileSchedule
|
||||
// and launch initial project reconcile since both config and recipes are present
|
||||
startListeningToPerformReconcile();
|
||||
scheduleValidationForAllProjects();
|
||||
log.info("Started project reconciler for Java sources");
|
||||
});
|
||||
} else {
|
||||
startListeningToPerformReconcile();
|
||||
scheduleValidationForAllProjects();
|
||||
log.info("Started project reconciler for Java sources");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,10 +9,8 @@
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!--
|
||||
<root level="info">
|
||||
<appender-ref ref="STDOUT" />
|
||||
</root>
|
||||
-->
|
||||
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user