()
| 438 | }, |
| 439 | |
| 440 | finalize(): void { |
| 441 | flushParserStates(); |
| 442 | if (structuredOutput) { |
| 443 | if (!sawIncomingNonHeaderEvent) { |
| 444 | const structuredItems = renderDomainResultTextItems( |
| 445 | structuredOutput.result, |
| 446 | structuredOutput.renderHints, |
| 447 | ); |
| 448 | const replayItems = |
| 449 | sawIncomingHeaderEvent && structuredItems[0]?.type === 'header' |
| 450 | ? structuredItems.slice(1) |
| 451 | : structuredItems; |
| 452 | for (const item of replayItems) { |
| 453 | processItem(item); |
| 454 | } |
| 455 | } else if (!sawIncomingNonSummaryEvent) { |
| 456 | const structuredItems = renderDomainResultTextItems( |
| 457 | structuredOutput.result, |
| 458 | structuredOutput.renderHints, |
| 459 | ); |
| 460 | const replayItems = structuredItems.filter((item) => { |
| 461 | if (sawIncomingHeaderEvent && item.type === 'header') return false; |
| 462 | return true; |
| 463 | }); |
| 464 | for (const item of replayItems) { |
| 465 | processItem(item); |
| 466 | } |
| 467 | } else { |
| 468 | const finalItems = createStreamingFinalItems(structuredOutput.result); |
| 469 | for (const item of finalItems) { |
| 470 | processItem(item); |
| 471 | } |
| 472 | } |
| 473 | } else if (pendingStreamedSummary) { |
| 474 | processItem(pendingStreamedSummary); |
| 475 | } |
| 476 | flushGroupedDiagnostics(lastSummaryStatus !== 'SUCCEEDED'); |
| 477 | groupedCompilerErrors.length = 0; |
| 478 | groupedTestFailures.length = 0; |
| 479 | groupedWarnings.length = 0; |
| 480 | const nextStepsBlock = includeNextSteps |
| 481 | ? createNextStepsBlock(nextSteps, nextStepsRuntime) |
| 482 | : null; |
| 483 | if (nextStepsBlock && !sawProgressNextSteps) { |
| 484 | processItem(nextStepsBlock); |
| 485 | } |
| 486 | sink.clearTransient(); |
| 487 | pendingTransientRuntimeLine = null; |
| 488 | diagnosticBaseDir = null; |
| 489 | hasDurableRuntimeContent = false; |
| 490 | lastVisibleEventType = null; |
| 491 | lastStatusLineLevel = null; |
| 492 | lastSummaryStatus = null; |
| 493 | structuredOutput = undefined; |
| 494 | sawIncomingHeaderEvent = false; |
| 495 | sawIncomingNonHeaderEvent = false; |
| 496 | sawIncomingSummaryEvent = false; |
| 497 | sawIncomingNonSummaryEvent = false; |
nothing calls this directly
no test coverage detected