Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 5, 2025

  • Add detailed Remarks section to TypeMapAttribute<TTypeMapGroup> class documentation with:
    • Usage explanation for type mapping between strings and types
    • Trimming rules for External Type Map
    • List of IL instructions that trigger type map entry inclusion
  • Add detailed Remarks section to TypeMapAssociationAttribute<TTypeMapGroup> class documentation with:
    • Usage explanation for type associations between source and proxy types
    • Trimming rules for Proxy Type Map
    • List of IL instructions that trigger type association entry inclusion
  • Fixed typo in constructor parameter description
  • Improved readability per code review feedback
  • Applied PR review suggestions: use xref format for type references
  • Fixed TypeMapAssemblyTarget xref (removed Attribute suffix per review)
  • Changed "it's not" to "isn't" for consistent conversational tone
Original prompt

This section details on the original issue you should resolve

<issue_title>TypeMapAttribute/TypeMapAssociationAttribute Add design usage notes to documentation</issue_title>
<issue_description>Design details and usage requirements should be pushed into the "Remarks" section of the two APIs.

https://learn.microsoft.com/dotnet/api/system.runtime.interopservices.typemapassociationattribute-1
https://learn.microsoft.com/dotnet/api/system.runtime.interopservices.typemapattribute-1

The design details can be found at https://github.com/dotnet/runtime/blob/main/docs/design/features/typemap.md.</issue_description>

<agent_instructions>The primary data in the design doc are the bulleted list for how the attributes influence trimming logic.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@AaronRobinsonMSFT /cc @Sergio0694 @AaronRobinsonMSFT /cc @jkoritzinsky @jtschuster @sbomer @agocke @MichalStrehovsky

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add design usage notes to TypeMapAttribute documentation Add design usage notes to TypeMapAttribute and TypeMapAssociationAttribute documentation Dec 5, 2025
Copy link
Contributor

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 comprehensive design documentation to the TypeMapAttribute<TTypeMapGroup> and TypeMapAssociationAttribute<TTypeMapGroup> classes, documenting their trimming behavior based on the runtime design specification. The documentation clarifies how these attributes influence trimming logic for interop scenarios.

Key changes:

  • Added detailed Remarks sections explaining External Type Map and Proxy Type Map behavior during trimming
  • Documented specific IL instructions that trigger map entry inclusion (e.g., ldtoken, unbox, isinst, castclass, box, newarr, newobj)
  • Fixed a typo in the TypeMapAttribute constructor parameter description ("kthe" → "the")

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
xml/System.Runtime.InteropServices/TypeMapAttribute`1.xml Adds Remarks section documenting unmanaged-to-managed interop type mapping behavior, lists IL instructions triggering External Type Map inclusion, and fixes typo in constructor parameter
xml/System.Runtime.InteropServices/TypeMapAssociationAttribute`1.xml Adds Remarks section documenting managed-to-unmanaged interop proxy type associations, lists IL instructions triggering Proxy Type Map inclusion, and explains special handling for interface types with IDynamicInterfaceCastable

@AaronRobinsonMSFT
Copy link
Member

/cc @gewarren

Copy link
Member

@AaronRobinsonMSFT AaronRobinsonMSFT left a comment

Choose a reason for hiding this comment

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

@copilot Please apply comment feedback.

Copy link
Contributor

@gewarren gewarren left a comment

Choose a reason for hiding this comment

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

lgtm

@AaronRobinsonMSFT AaronRobinsonMSFT merged commit 116abd6 into main Dec 11, 2025
7 of 9 checks passed
@AaronRobinsonMSFT AaronRobinsonMSFT deleted the copilot/add-design-notes-to-typemap-attributes branch December 11, 2025 12:50
@AaronRobinsonMSFT
Copy link
Member

Looks like there is some formatting issues. I'll put up another PR and fix them up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeMapAttribute/TypeMapAssociationAttribute Add design usage notes to documentation

5 participants