Skip to content

[api] Diagnostic utility APIs - #65587

Merged
Andrew Branch (andrewbranch) merged 2 commits into
microsoft:mainfrom
andrewbranch:diagnostic-utility-apis
Nov 20, 2026
Merged

Andrew Branch (andrewbranch) merged 2 commits into
microsoft:mainfrom
andrewbranch:diagnostic-utility-apis

Conversation

@andrewbranch

Copy link
Copy Markdown
Member
  • flattenDiagnosticMessage
  • sortAndDeduplicateDiagnostics

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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 review identifies no active issues with the diagnostic utility API additions.

No open issues 🎉

What changed in this PR

Adds diagnostic utility APIs to the TypeScript JavaScript client, available through both async and sync entry points.

Changes:

  • Exposes flattenDiagnosticMessage with configurable newlines and indentation.
  • Adds sortAndDeduplicateDiagnostics, preserving distinct message chains and related information without mutating input.
  • Adds tests covering ordering, stable deduplication, and message flattening for both entry points.
File Description
packages/​typescript/​test/​diagnosticFormatter.test.ts Tests both utilities through async and sync exports.
packages/​typescript/​src/​api/​sync/​api.ts Exports both diagnostic utilities.
packages/​typescript/​src/​api/​diagnosticUtils.ts Implements diagnostic sorting and deduplication.
packages/​typescript/​src/​api/​diagnosticFormatter.ts Exports and documents the existing message-flattening helper.
packages/​typescript/​src/​api/​async/​api.ts Exports both diagnostic utilities.

Review effort: Balanced

@andrewbranch
Andrew Branch (andrewbranch) marked this pull request as ready for review November 19, 2026 19:57

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I miss this || trickery stuff

@andrewbranch
Andrew Branch (andrewbranch) added this pull request to the merge queue Nov 20, 2026
Merged via the queue into microsoft:main with commit 89aecc9 Nov 20, 2026
61 of 63 checks passed
@andrewbranch
Andrew Branch (andrewbranch) deleted the diagnostic-utility-apis branch November 20, 2026 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants