Skip to content

Add CompositeFormat class reference to composite formatting docs#53686

Merged
adegeo merged 6 commits into
mainfrom
copilot/add-composite-format-class-reference
May 14, 2026
Merged

Add CompositeFormat class reference to composite formatting docs#53686
adegeo merged 6 commits into
mainfrom
copilot/add-composite-format-class-reference

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 12, 2026

  • Add CompositeFormatDemo C# snippet showing CompositeFormat usage to the existing snippet file
  • Add CompositeFormatDemo VB snippet showing CompositeFormat usage to the existing snippet file
  • Add "Improve performance with CompositeFormat" section to composite-formatting.md
  • Update the See also section to include CompositeFormat API link
  • Validate the code snippets build and run correctly
  • Address code review: restore Imports System in VB file, improve code comments, fix passive voice
  • Remove CA1863 link from See also section (per reviewer feedback)
  • Fix relative path to CA1863 rule link (two segments back, not three)

Internal previews

📄 File 🔗 Preview link
docs/standard/base-types/composite-formatting.md Composite formatting

Copilot AI self-assigned this May 12, 2026
Copilot AI review requested due to automatic review settings May 12, 2026 17:03
Copilot AI review requested due to automatic review settings May 12, 2026 17:03
Copilot AI requested review from Copilot and removed request for Copilot May 12, 2026 17:07
… passive voice

Agent-Logs-Url: https://github.com/dotnet/docs/sessions/dd16e561-6b82-4867-8a98-20e6d2548480

Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 12, 2026 17:08
Copilot AI changed the title [WIP] Update documentation to mention CompositeFormat class Add CompositeFormat class reference to composite formatting docs May 12, 2026
Copilot finished work on behalf of adegeo May 12, 2026 17:09
Copilot AI requested a review from adegeo May 12, 2026 17:09
Comment thread docs/standard/base-types/composite-formatting.md Outdated
Agent-Logs-Url: https://github.com/dotnet/docs/sessions/852f2c56-67d5-4a3b-9dbc-de2fce785e97

Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 14, 2026 16:16
Copilot finished work on behalf of adegeo May 14, 2026 16:17
Copilot AI requested a review from adegeo May 14, 2026 16:17
Comment thread docs/standard/base-types/composite-formatting.md Outdated
Copilot AI requested review from Copilot and removed request for Copilot May 14, 2026 16:34
Copilot finished work on behalf of adegeo May 14, 2026 16:35
Copilot AI requested a review from adegeo May 14, 2026 16:35
@adegeo adegeo marked this pull request as ready for review May 14, 2026 16:50
@adegeo adegeo requested a review from a team as a code owner May 14, 2026 16:50
Copilot AI review requested due to automatic review settings May 14, 2026 16:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the composite formatting documentation to introduce System.Text.CompositeFormat (available starting in .NET 8) as a performance optimization when you reuse the same composite format string.

Changes:

  • Add a new “Improve performance with CompositeFormat” section to the composite formatting article, including CA1863 guidance and a CompositeFormat API reference.
  • Add C# and Visual Basic snippet regions demonstrating CompositeFormat.Parse(...) and formatting with the cached format.
  • Wire the new snippet regions into the existing snippet runners by invoking CompositeFormatDemo().

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
docs/standard/base-types/snippets/composite-formatting/net/vb/Program.vb Adds a VB CompositeFormatDemo snippet region and calls it from Main.
docs/standard/base-types/snippets/composite-formatting/net/csharp/Program.cs Adds a C# CompositeFormatDemo snippet region and calls it from the top-level driver.
docs/standard/base-types/composite-formatting.md Adds a new performance section for CompositeFormat, links the new snippets, and adds CompositeFormat to See also.

Comment thread docs/standard/base-types/composite-formatting.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@adegeo adegeo enabled auto-merge (squash) May 14, 2026 18:51
@adegeo adegeo removed the :octocat: auto-merge label May 14, 2026
Copy link
Copy Markdown
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

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

This LGTM. Let's :shipit:

@adegeo adegeo merged commit 91ee750 into main May 14, 2026
13 checks passed
@adegeo adegeo deleted the copilot/add-composite-format-class-reference branch May 14, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation on composite formatting should mention the newer CompositeFormat class

4 participants