MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / finalize

Function finalize

src/utils/renderers/cli-text-renderer.ts:440–505  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls 8

createNextStepsBlockFunction · 0.90
flushParserStatesFunction · 0.85
processItemFunction · 0.85
flushGroupedDiagnosticsFunction · 0.85
clearTransientMethod · 0.80
clearMethod · 0.65

Tested by

no test coverage detected