Skip to content

API: add formatDiagnostic and flattenDiagnosticMessageText - #64150

Open
Matheus Mol (oMatheusmol) wants to merge 1 commit into
microsoft:mainfrom
oMatheusmol:api/diagnostic-format-helpers
Open

API: add formatDiagnostic and flattenDiagnosticMessageText#64150
Matheus Mol (oMatheusmol) wants to merge 1 commit into
microsoft:mainfrom
oMatheusmol:api/diagnostic-format-helpers

Conversation

@oMatheusmol

Copy link
Copy Markdown
Contributor

Adds the two remaining per-diagnostic helpers from the 6.x API that were left out when formatDiagnostics was ported in #63935 (roadmap #63875).

Copilot AI balanced review requested due to automatic review settings September 3, 2026 16:46
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Sep 3, 2026
@typescript-automation typescript-automation Bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Sep 3, 2026
@typescript-automation

Copy link
Copy Markdown

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation is focused, preserves existing formatter behavior, and includes appropriate API coverage.

Pull request overview

Adds the remaining single-diagnostic formatting utilities to the synchronous and asynchronous TypeScript APIs.

Changes:

  • Exports formatDiagnostic and flattenDiagnosticMessageText.
  • Reuses these helpers in existing formatters.
  • Adds API tests for formatting and nested message chains.
File summaries
File Description
packages/typescript/src/api/diagnosticFormatter.ts Implements and integrates the new helpers.
packages/typescript/src/api/async/api.ts Exports helpers from the async API.
packages/typescript/src/api/sync/api.ts Exports helpers from the sync API.
packages/typescript/test/diagnosticFormatter.test.ts Tests formatting, composition, and message-chain flattening.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

2 participants