CompletableFuture<Boolean> (Value value, EvaluationContext context, NodeDescriptor parentDescriptor) { CompletableFuture<Boolean> res = new CompletableFuture<>(); EvaluationContextImpl evaluationContextImpl = (EvaluationContextImpl)context; DebugProcessImpl debugProcess = evaluationContextImpl.getDebugProcess(); debugProcess.getManagerThread().schedule(new PossiblySyncCommand(evaluationContextImpl.getSuspendContext()) { @Override public void syncAction(@NotNull SuspendContextImpl suspendContext) { EvaluationContext evaluationContext = context.createEvaluationContext(value); if (!StringUtil.isEmpty(myChildrenExpandable.getReferenceExpression().getText())) { try { Value expanded = myChildrenExpandable.getEvaluator(evaluationContext.getProject()).evaluate(evaluationContext); if (expanded instanceof BooleanValue) { res.complete(((BooleanValue)expanded).booleanValue()); return; } } catch (EvaluateException e) { // ignored } } try { Value children = evaluateChildren(evaluationContext, parentDescriptor); DebugProcessImpl.getDefaultRenderer(value.type()) .isExpandableAsync(children, evaluationContext, parentDescriptor) .whenComplete((aBoolean, throwable) -> DebuggerUtilsAsync.completeFuture(aBoolean, throwable, res)); } catch (EvaluateException e) { res.complete(true); } } @Override protected void commandCancelled() { res.cancel(false); } }); return res; }