public static <T> T commitAndRunReadAction(Project project, final EvaluatingComputable<T> computable) throws EvaluateException {
    final Throwable[] ex = new Throwable[]{null};
    T result = PsiDocumentManager.getInstance(project).commitAndRunReadAction(() -> {
      try {
        return computable.compute();
      }
      catch (RuntimeException | EvaluateException e) {
        ex[0] = e;
      }

      return null;
    });

    if (ex[0] != null) {
      if (ex[0] instanceof RuntimeException) {
        throw (RuntimeException)ex[0];
      }
      else {
        throw (EvaluateException)ex[0];
      }
    }

    return result;
  }
public static <T> T commitAndRunReadAction(Project project, final EvaluatingComputable<T> computable)