Add XML doc comments to Incremental Generator public API#80609
Add XML doc comments to Incremental Generator public API#80609
Conversation
Co-authored-by: timheuer <4821+timheuer@users.noreply.github.com>
Co-authored-by: timheuer <4821+timheuer@users.noreply.github.com>
|
@dotnet/roslyn-compiler for a second review |
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive XML documentation comments to the incremental generator public API to improve developer experience when writing source generators. Previously, these APIs lacked IntelliSense documentation, making it challenging for developers to understand their functionality without external documentation.
Key changes include:
- Added detailed XML doc comments to all public extension methods in
ValueSourceExtensions.cs - Added comprehensive documentation to all public properties and methods in
IncrementalGeneratorInitializationContext - Included clear descriptions, parameter explanations, return value details, and usage context for each API
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/Compilers/Core/Portable/SourceGeneration/Nodes/ValueSourceExtensions.cs |
Added XML documentation for all LINQ-like extension methods (Select, SelectMany, Collect, Combine, Where, WithComparer, WithTrackingName) |
src/Compilers/Core/Portable/SourceGeneration/IncrementalContexts.cs |
Added XML documentation for provider properties (SyntaxProvider, CompilationProvider, etc.) and registration methods (RegisterSourceOutput, RegisterImplementationSourceOutput, etc.) |
src/Compilers/Core/Portable/SourceGeneration/Nodes/ValueSourceExtensions.cs
Show resolved
Hide resolved
src/Compilers/Core/Portable/SourceGeneration/Nodes/ValueSourceExtensions.cs
Show resolved
Hide resolved
|
@copilot can you address Copilot's feedback? |
| { | ||
| /// <summary> | ||
| /// Transforms an <see cref="IncrementalValueProvider{TSource}"/> into a new <see cref="IncrementalValueProvider{TResult}"/> by applying a transform function to the value. | ||
| /// This is a 1-to-1 transformation where each input value produces exactly one output value. |
There was a problem hiding this comment.
@copilot I've applied suggestions from Copilot reviewer to clarify some docs, but there are more overloads that should be clarified similarly
There was a problem hiding this comment.
Applied similar clarifications to all remaining overloads in commit b0c29fc:
- Added "1-to-1 transformation" clarification to Select on IncrementalValuesProvider
- Added "1-to-many transformation" clarification to second SelectMany on IncrementalValueProvider
- Added "many-to-many transformation" clarifications to both SelectMany overloads on IncrementalValuesProvider
- Added host clarification to second RegisterHostOutput method
Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
Add XML doc comments to Incremental Generator public API
This PR adds comprehensive XML documentation comments to the incremental generator public API to improve the developer experience when writing incremental generators.
Changes completed:
ValueSourceExtensions.cs:IncrementalContexts.cs:Summary:
All public extension methods in
ValueSourceExtensions.csand public properties/methods inIncrementalContexts.csnow have detailed XML documentation comments with:These comments now appear in IntelliSense when developers write incremental generators, making it easier to understand the API without referring to external documentation.
Original prompt
Fixes #79932
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.