@NotNull
  @Override
  public Promise<XExpression> calculateEvaluationExpression() {
    if (evaluationExpression != null) {
      return Promises.resolvedPromise(evaluationExpression);
    }
    else {
      final AsyncPromise<XExpression> result = new AsyncPromise<>();
      myEvaluationContext.getManagerThread().schedule(new SuspendContextCommandImpl(myEvaluationContext.getSuspendContext()) {
        @Override
        public Priority getPriority() {
          return Priority.HIGH;
        }

        @Override
        public void contextAction(@NotNull SuspendContextImpl suspendContext) {
          try {
            getDescriptor().getTreeEvaluation(JavaValue.this, getDebuggerContext())
              .whenComplete((psiExpression, ex) -> {
                if (ex != null) {
                  result.setError(ex);
                }
                else if (psiExpression != null) {
                  ReadAction.nonBlocking(() -> {
                    XExpression res = TextWithImportsImpl.toXExpression(new TextWithImportsImpl(psiExpression));
                    // add runtime imports if any
                    Set<String> imports = psiExpression.getUserData(DebuggerTreeNodeExpression.ADDITIONAL_IMPORTS_KEY);
                    if (imports != null && res != null) {
                      if (res.getCustomInfo() != null) {
                        imports.add(res.getCustomInfo());
                      }
                      res = new XExpressionImpl(res.getExpression(), res.getLanguage(), StringUtil.join(imports, ","), res.getMode());
                    }
                    evaluationExpression = res;
                    result.setResult(res);
                  }).executeSynchronously();
                }
                else {
                  result.setError("Null");
                }
              });
          }
          catch (EvaluateException e) {
            LOG.info(e);
            result.setError(e);
          }
        }

        @Override
        protected void commandCancelled() {
          result.setError("Cancelled");
        }
      });
      return result;
    }
  }
@NotNull
  @Override
  public Promise<XExpression> calculateEvaluationExpression()