-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Add XML documentation to DynamicMethod from dotnet-api-docs #124227
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: gewarren <[email protected]>
gewarren
left a comment
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.
@copilot Please address all feedback.
src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.CoreCLR.cs
Outdated
Show resolved
Hide resolved
src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.CoreCLR.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.cs
Show resolved
Hide resolved
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.
Since the /// docs are already in the DynamicMethod.CoreCLR.cs file, I don't think we need to add them here too.
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.
Removed duplicate documentation from Mono file in commit 2f4fe14. Documentation is now only in CoreCLR file.
Co-authored-by: gewarren <[email protected]>
All feedback addressed in commit 2f4fe14. Changes include:
|
Co-authored-by: gewarren <[email protected]>
Co-authored-by: gewarren <[email protected]>
src/libraries/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.cs
Show resolved
Hide resolved
Co-authored-by: gewarren <[email protected]>
Co-authored-by: gewarren <[email protected]>
src/libraries/System.Private.CoreLib/samples/System/Reflection/Emit/DynamicMethod.Examples.cs
Show resolved
Hide resolved
Co-authored-by: gewarren <[email protected]>
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 PR backports XML documentation for System.Reflection.Emit.DynamicMethod from dotnet-api-docs into dotnet/runtime, including supplemental remarks links and externalized code examples referenced from XML docs.
Changes:
- Added comprehensive XML documentation to
DynamicMethod(type + members) including supplemental remarks links and<example>blocks that pull code from a samples file. - Added a new
DynamicMethod.Examples.cssamples file with#region-scoped snippets for XML doc inclusion. - Added/adjusted CoreCLR-specific XML documentation for
CreateDelegate,Invoke, and IL-related APIs (and removed duplicate docs from the Mono implementation per PR description).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/libraries/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.cs | Adds extensive XML docs, supplemental remarks links, and <example> references for many members. |
| src/libraries/System.Private.CoreLib/samples/System/Reflection/Emit/DynamicMethod.Examples.cs | Adds snippet source file used by <code source="..." region="..."/> in XML docs. |
| src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.CoreCLR.cs | Adds XML docs for CoreCLR-implemented members (CreateDelegate, Invoke, GetILGenerator(int), GetDynamicILInfo). |
src/libraries/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/samples/System/Reflection/Emit/DynamicMethod.Examples.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
|
@copilot What's the best way to aggregate all the feedback and instructions you were given during the process of fine-tuning these changes such that it can be reused in the future to backport doc comments for more types in this repo? |
The process and conventions learned from this PR can be documented as follows: XML Documentation Backport Process for dotnet/runtime:
Key conventions: Use |
|
@copilot Should those instructions be stored as an agent in this repo? Or something else? |
I'd recommend adding it to Alternatively, if you want a more interactive/executable approach, it could be a skill in
The prompt approach is simpler for reference/manual work, while a skill would provide automation. Given that backporting is likely infrequent and requires human review of member-specific nuances (supplemental links, platform differences), the prompt documentation approach seems more practical. |
Contributes to dotnet/dotnet-api-docs#12307.
Description
Backported XML documentation comments from
dotnet/dotnet-api-docsto theDynamicMethodclass. Per requirements, specific members (constructors,CreateDelegate,GetILGenerator,Invoke,IsSecurityCritical) include remarks linking to supplemental API documentation. Each member links to its specific article in the dotnet/docs repository.These documents will become available when dotnet/docs#51571 merges.
Changes Made
Documentation Added
<summary>and<remarks>with supplemental link to theDynamicMethodclass declaration<summary>,<param>,<exception>, and<remarks>with supplemental links to the parent type articleCode Examples
#regionblocks, following the Newtonsoft.Json documentation pattern<example>sections to 12 members (Name, DeclaringType, ReflectedType, Module, Attributes, CallingConvention, GetParameters, ReturnType, ReturnTypeCustomAttributes, DefineParameter, ToString, InitLocals) that reference the Examples.cs file using<code lang="cs" source="../../../../samples/System/Reflection/Emit/DynamicMethod.Examples.cs" region="..." />Other Changes
Files Modified
src/libraries/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.cs- Main file with complete documentation including all remarks and example references (407 lines added)src/libraries/System.Private.CoreLib/samples/System/Reflection/Emit/DynamicMethod.Examples.cs- New file with code examples in #region blocks (143 lines added)src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.CoreCLR.cs- CoreCLR-specific members with fixed supplemental links (59 lines added, 11 lines modified)src/mono/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.Mono.cs- Removed duplicate documentation (48 lines removed)Total: 561 net lines added across all implementations with complete remarks and examples backported from dotnet-api-docs.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.