use of org.springframework.ide.vscode.commons.languageserver.util.LanguageServerTestListener in project sts4 by spring-projects.
the class LanguageServerHarness method reconcilerThreadStart.
/**
* Blocks the reconciler thread until a specific point in time explicitly controlled by the test.
*/
public SynchronizationPoint reconcilerThreadStart() {
CompletableFuture<Void> blocker = new CompletableFuture<>();
getServer().setTestListener(new LanguageServerTestListener() {
@Override
public void reconcileStarted(String uri, int version) {
try {
blocker.get();
} catch (Exception e) {
throw ExceptionUtil.unchecked(e);
}
}
});
return new SynchronizationPoint() {
@Override
public void unblock() {
blocker.complete(null);
}
@Override
public Future<Void> reached() {
return blocker;
}
};
}
Aggregations