Skip to content

Commit 4a2a135

Browse files
committed
Attempt at fixing busyReconcile flag
1 parent f263414 commit 4a2a135

File tree

1 file changed

+9
-2
lines changed
  • headless-services/commons/commons-language-server/src/main/java/org/springframework/ide/vscode/commons/languageserver/util

1 file changed

+9
-2
lines changed

headless-services/commons/commons-language-server/src/main/java/org/springframework/ide/vscode/commons/languageserver/util/SimpleLanguageServer.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,11 @@ public void validateWith(TextDocumentIdentifier docId, IReconcileEngine engine)
615615
log.debug("Reconcile skipped due to document doesn't exist anymore {}", docId.getUri());
616616
return;
617617
}
618-
618+
619+
if (reconcileRequests.isEmpty()) {
620+
busyReconcile = new CompletableFuture<>();
621+
}
622+
619623
String uri = docId.getUri();
620624
CompletableFuture<Void> newFuture = new CompletableFuture<Void>();
621625
CompletableFuture<Void> oldFuture = reconcileRequests.putIfAbsent(uri, newFuture);
@@ -624,7 +628,7 @@ public void validateWith(TextDocumentIdentifier docId, IReconcileEngine engine)
624628
return;
625629
}
626630

627-
CompletableFuture<Void> reconcileSession = this.busyReconcile = oldFuture == null ? newFuture : oldFuture;
631+
CompletableFuture<Void> reconcileSession = oldFuture == null ? newFuture : oldFuture;
628632
// Log.debug("Reconciling BUSY");
629633

630634
// Avoid running in the same thread as lsp4j as it can result
@@ -707,6 +711,9 @@ public void accept(ReconcileProblem problem) {
707711
})
708712
.doFinally(ignore -> {
709713
reconcileSession.complete(null);
714+
if (reconcileRequests.isEmpty()) {
715+
busyReconcile.complete(null);
716+
}
710717
// Log.debug("Reconciler DONE : "+this.busyReconcile.isDone());
711718
})
712719
.subscribe();

0 commit comments

Comments
 (0)