Skip to content

Conversation

@jcouv
Copy link
Member

@jcouv jcouv commented Jul 29, 2025

Closes #118179
Relates to feature test plan dotnet/roslyn#76130

@jcouv jcouv self-assigned this Jul 29, 2025
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jul 29, 2025
@jcouv jcouv changed the title Add ExtensionMarkerNameAttribute Add ExtensionMarkerAttribute Aug 5, 2025
@jcouv jcouv force-pushed the extension-attribute branch from a16ff24 to a914d7d Compare August 6, 2025 01:59
@jcouv jcouv force-pushed the extension-attribute branch from a914d7d to bcef225 Compare August 6, 2025 02:41
@jcouv jcouv marked this pull request as ready for review August 6, 2025 18:27
Copilot AI review requested due to automatic review settings August 6, 2025 18:27
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 a new ExtensionMarkerAttribute class to support a language feature for associating extension members with specific marker types. The attribute is designed for compiler use and includes appropriate metadata to discourage direct developer usage.

Key Changes

  • Adds new ExtensionMarkerAttribute class with a Name property for marker type association
  • Includes comprehensive attribute metadata (EditorBrowsable, AttributeUsage) to control visibility and usage
  • Provides complete implementation with API surface, tests, and project configuration

Reviewed Changes

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

File Description
src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/ExtensionMarkerAttribute.cs New attribute implementation with constructor, Name property, and XML documentation
src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems Adds the new file to the build configuration
src/libraries/System.Runtime/ref/System.Runtime.cs Adds the public API surface definition for the new attribute
src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Runtime/CompilerServices/AttributesTests.cs Adds unit tests to verify constructor and Name property functionality

@tannergooding tannergooding removed the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Aug 7, 2025
@tannergooding tannergooding added this to the 10.0.0 milestone Aug 7, 2025
@tannergooding
Copy link
Member

CC. @jeffhandley for M1 approval.

This is just the attribute used by Roslyn for the extension member feature so it can avoid synthesizing it into every assembly.

Copy link
Member

@jeffhandley jeffhandley left a comment

Choose a reason for hiding this comment

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

Approved for RC1

@jeffhandley jeffhandley merged commit ebde052 into dotnet:main Aug 8, 2025
138 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Sep 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API Proposal]: ExtensionMarkerAttribute

3 participants