Skip to content

Add boilerplate documentation to generated types #30259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mlorbetske
Copy link

Description of Change

Add boilerplate documentation to types and constructors produced by CodeBehindGenerator to prevent CS1591 from being raised on these members when documentation build is turned on.

Issues Fixed

Fixes #27911

@Copilot Copilot AI review requested due to automatic review settings June 26, 2025 23:01
@mlorbetske mlorbetske requested a review from a team as a code owner June 26, 2025 23:01
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Jun 26, 2025
Copy link
Contributor

Hey there @@mlorbetske! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

Copy link
Contributor

@Copilot 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 adds XML documentation boilerplate to code-behind classes and their default constructors generated by CodeBehindGenerator, preventing CS1591 warnings during documentation builds.

Comments suppressed due to low confidence (1)

src/Controls/src/SourceGen/CodeBehindGenerator.cs:307

  • [nitpick] Consider referencing the generated class's CLR type name rather than the file path in the summary (e.g. 'Generated XAML code-behind for MainPage') to improve clarity for consumers.
		sb.AppendLine($"\t/// Generated XAML code behind for {projItem.RelativePath}");

@@ -303,6 +303,9 @@ static void GenerateXamlCodeBehind(XamlProjectItem? xamlItem, Compilation compil

sb.AppendLine($"namespace {rootClrNamespace}");
sb.AppendLine("{");
sb.AppendLine($"\t/// <summary>");
Copy link
Preview

Copilot AI Jun 26, 2025

Choose a reason for hiding this comment

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

Public docs live in XML under /docs/. Please update the relevant docs XML to describe the new boilerplate documentation feature so public documentation aligns with code changes.

Copilot uses AI. Check for mistakes.

@@ -320,6 +323,9 @@ static void GenerateXamlCodeBehind(XamlProjectItem? xamlItem, Compilation compil
//optional default ctor
if (generateDefaultCtor)
{
sb.AppendLine($"\t\t/// <summary>");
Copy link
Preview

Copilot AI Jun 26, 2025

Choose a reason for hiding this comment

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

Ensure there are automated tests in TestCases.Shared.Tests and TestCases.HostApp that verify CodeBehindGenerator emits the expected <summary> comments for generated types and constructors.

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community ✨ Community Contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resource files generates warnings when comment file is enabled
1 participant