Skip to content

Conversation

@Sergio0694
Copy link
Member

Title. This just makes things more consistent.

Changed WindowsRuntimeConstants from internal to public, marked it as obsolete with diagnostic information, and added EditorBrowsable(Never) to discourage usage. This improves API clarity and guides developers away from using internal implementation details.
Updated the [Obsolete] attribute in generated code to include message, DiagnosticId, and UrlFormat from WindowsRuntimeConstants. This provides more detailed diagnostic information and guidance for deprecated members.
Copy link

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 updates the obsolete attribute usage in generated projection assemblies to match the detailed format used in the 'WinRT.Runtime' assembly, improving consistency across the codebase.

Changes:

  • Updated generated code to use detailed Obsolete attributes with message, diagnostic ID, and URL format
  • Changed WindowsRuntimeConstants visibility from internal to public to enable access from projection assemblies
  • Applied Obsolete and EditorBrowsable attributes to WindowsRuntimeConstants class itself

Reviewed changes

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

File Description
src/cswinrt/code_writers.h Updated code generation to emit detailed Obsolete attributes (with message, diagnostic ID, and URL format) for IsOverridableInterface and HasUnwrappableNativeObjectReference methods in generated projection code
src/WinRT.Runtime2/Properties/WindowsRuntimeConstants.cs Changed class visibility to public, added necessary using statements, and applied Obsolete/EditorBrowsable attributes to the class itself to match the pattern of other private implementation detail classes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Sergio0694 Sergio0694 merged commit 1bc1ca0 into staging/3.0 Jan 25, 2026
16 checks passed
@Sergio0694 Sergio0694 deleted the user/sergiopedri/obsolete-messages branch January 25, 2026 01:35
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.

3 participants