-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -303,6 +303,9 @@ static void GenerateXamlCodeBehind(XamlProjectItem? xamlItem, Compilation compil | |||||
|
||||||
sb.AppendLine($"namespace {rootClrNamespace}"); | ||||||
sb.AppendLine("{"); | ||||||
sb.AppendLine($"\t/// <summary>"); | ||||||
sb.AppendLine($"\t/// Generated XAML code behind for {projItem.RelativePath}"); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is a great summary to end up in class documentation - those paths doesn't make sense in IntelliSense. Seems cleaner to just add a |
||||||
sb.AppendLine($"\t/// </summary>"); | ||||||
sb.AppendLine($"\t[global::Microsoft.Maui.Controls.Xaml.XamlFilePath(\"{projItem.RelativePath?.Replace("\\", "\\\\")}\")]"); | ||||||
if (addXamlCompilationAttribute) | ||||||
{ | ||||||
|
@@ -320,6 +323,9 @@ static void GenerateXamlCodeBehind(XamlProjectItem? xamlItem, Compilation compil | |||||
//optional default ctor | ||||||
if (generateDefaultCtor) | ||||||
{ | ||||||
sb.AppendLine($"\t\t/// <summary>"); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||
sb.AppendLine($"\t\t/// Creates a new {rootType}"); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should follow the standard doc convention for constructors, otherwise anyone having standard doc enforced in their code analyzers would just generate warnings here.
Suggested change
|
||||||
sb.AppendLine($"\t\t/// </summary>"); | ||||||
sb.AppendLine($"\t\t[global::System.CodeDom.Compiler.GeneratedCode(\"Microsoft.Maui.Controls.SourceGen\", \"1.0.0.0\")]"); | ||||||
sb.AppendLine($"\t\tpublic {rootType}()"); | ||||||
sb.AppendLine("\t\t{"); | ||||||
|
There was a problem hiding this comment.
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.