-
-
Notifications
You must be signed in to change notification settings - Fork 6
Add XML doc comment support for generated properties #377
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
Conversation
This update enhances the source generator to extract and include XML documentation comments for generated properties, improving IntelliSense and documentation. It also updates the PropertyInfo model to store XML comments, adjusts code generation to use these comments, and adds a summary for an internal test property. Minor code cleanup and a new .slnx solution file are included.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #377 +/- ##
==========================================
- Coverage 43.52% 43.33% -0.20%
==========================================
Files 75 75
Lines 3993 4020 +27
Branches 485 488 +3
==========================================
+ Hits 1738 1742 +4
- Misses 2096 2119 +23
Partials 159 159 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Added support to extract and include XML documentation comments from method symbols into the generated command properties. This helps retain developer documentation in the generated code for better maintainability and IntelliSense support.
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.
Pull request overview
This pull request adds support for XML documentation comments in source-generated properties and commands for the [Reactive] and [ReactiveCommand] attributes, addressing issue #375. The implementation extracts XML documentation from annotated members using Roslyn's GetDocumentationCommentXml API and includes it in the generated code.
Changes:
- Enhanced PropertyInfo and CommandInfo models to store XML documentation comments
- Implemented XML comment extraction logic in both ReactiveGenerator and ReactiveCommandGenerator
- Added example XML documentation to test view model
- Fixed inheritdoc cref formatting issue (removed incorrect "this." prefix)
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| ReactiveCommandGenerator.Execute.cs | Adds XML documentation extraction from method symbols and includes it in generated command properties |
| CommandInfo.cs | Extends model with XmlComment property to store extracted documentation |
| ReactiveGenerator.Execute.cs | Adds XML documentation extraction from property symbols with fallback to inheritdoc for partial properties |
| PropertyInfo.cs | Extends model with XmlComment property to store extracted documentation |
| FieldSyntaxExtensions.cs | Adds unused System.Linq and CSharp.Syntax imports |
| TestViewModel.cs | Adds example XML documentation comment for internal test property |
| ReactiveGeneratorTests.FromReactivePropertiesCalledValue#TestNs.TestVM.Properties.g.verified.cs | Fixes inheritdoc cref reference from "this.value" to "value" |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What kind of change does this PR introduce?
Fixes #375
What is the current behavior?
Xml Comments are not generated correctly on [Reactive] attributes placed on partial properties.
Xml Comments are not generated correctly on [ReactiveCommand] Properties.
What is the new behavior?
This update enhances the source generator to extract and include XML documentation comments for generated properties, improving IntelliSense and documentation.
It also updates the PropertyInfo model to store XML comments, adjusts code generation to use these comments, and adds a summary for an internal test property.
Added support to extract and include XML documentation comments from method symbols into the generated command properties.
This helps retain developer documentation in the generated code for better maintainability and IntelliSense support.
Minor code cleanup and a new .slnx solution file are included.
What might this PR break?
Bug fix no change in operation
Please check if the PR fulfills these requirements
Other information: