Skip to content

Conversation

@StephaneDelcroix
Copy link
Contributor

Description of Change

[XSG] support xClassModifier

Issues Fixed

Fixes #31550 (comment)

Copilot AI review requested due to automatic review settings September 24, 2025 10:01
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 support for the x:ClassModifier attribute in XAML source generation (XSG), allowing developers to specify the access modifier for generated partial classes.

  • Adds x:ClassModifier to the list of recognized XML attributes in XAML parsing
  • Updates visitors to skip processing x:ClassModifier as a regular property
  • Updates test to validate that x:ClassModifier="Internal" generates an internal partial class

Reviewed Changes

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

Show a summary per file
File Description
XamlParser.cs Adds recognition of x:ClassModifier attribute in XML parsing
ApplyPropertiesVisitor.cs Adds x:ClassModifier to skip list to prevent it from being treated as a regular property
SetPropertiesVisitor.cs (SourceGen) Adds x:ClassModifier to skip list in source generation visitor
SetPropertiesVisitor.cs (Build.Tasks) Adds x:ClassModifier to skip list in build tasks visitor
BasicCase.cs Updates test case to validate x:ClassModifier="Internal" generates internal class

Comment on lines +286 to +287
case "ClassModifier":
return XmlName.xClassModifier;
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

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

The implementation adds support for parsing x:ClassModifier but there's no corresponding definition of XmlName.xClassModifier. Please ensure this constant is defined in the XmlName class to avoid compilation errors.

Copilot uses AI. Check for mistakes.
@StephaneDelcroix StephaneDelcroix merged commit f0719db into net10.0 Sep 25, 2025
150 of 153 checks passed
@StephaneDelcroix StephaneDelcroix deleted the dev/stdelc/xsg/fixXClass branch September 25, 2025 06:49
@PureWeen PureWeen mentioned this pull request Oct 21, 2025
2 tasks
@github-actions github-actions bot locked and limited conversation to collaborators Oct 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants