private static void waitForFutureUnlockingThread(@NotNull CompletableFuture<?> resultFuture) {
    if (ApplicationManager.getApplication().isWriteIntentLockAcquired()) {
      pollLaterInvocatorActively(resultFuture, LaterInvocator::pollWriteThreadEventsOnce);
      return;
    }
    if (EDT.isCurrentThreadEdt()) {
      throw new UnsupportedOperationException("Sync waiting from EDT is dangerous.");
    }
    try {
      resultFuture.get();
    }
    catch (Throwable ignore) {
    }
  }
private static void waitForFutureUnlockingThread(@NotNull CompletableFuture<?> resultFuture)