void (@NotNull StreamChain chain, @NotNull LibrarySupportProvider provider, @NotNull XDebugSession session) { final EvaluationAwareTraceWindow window = new EvaluationAwareTraceWindow(session, chain); ApplicationManager.getApplication().invokeLater(window::show); final Project project = session.getProject(); final TraceExpressionBuilder expressionBuilder = provider.getExpressionBuilder(project); final TraceResultInterpreterImpl resultInterpreter = new TraceResultInterpreterImpl(provider.getLibrarySupport().getInterpreterFactory()); final StreamTracer tracer = new EvaluateExpressionTracer(session, expressionBuilder, resultInterpreter); tracer.trace(chain, new TracingCallback() { @Override public void evaluated(@NotNull TracingResult result, @NotNull EvaluationContextImpl context) { final ResolvedTracingResult resolvedTrace = result.resolve(provider.getLibrarySupport().getResolverFactory()); ApplicationManager.getApplication() .invokeLater(() -> window.setTrace(resolvedTrace, context)); } @Override public void evaluationFailed(@NotNull String traceExpression, @NotNull String message) { notifyUI(message); throw new TraceEvaluationException(message, traceExpression); } @Override public void compilationFailed(@NotNull String traceExpression, @NotNull String message) { notifyUI(message); throw new TraceCompilationException(message, traceExpression); } private void notifyUI(@NotNull @Nls String message) { ApplicationManager.getApplication().invokeLater(() -> window.setFailMessage(message)); } }); }