-
-
Notifications
You must be signed in to change notification settings - Fork 105
Support internal classes and properties with ClassDataSource attribute #3370
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
Conversation
…issue Co-authored-by: thomhurst <[email protected]>
- Updated PropertyInjectionSourceGenerator to accept internal types - Updated reflection mode to discover internal properties - Updated DynamicallyAccessedMembers attributes to include NonPublic members - Added test case for internal class with internal property Co-authored-by: thomhurst <[email protected]>
Co-authored-by: thomhurst <[email protected]>
Co-authored-by: thomhurst <[email protected]>
|
@copilot undo the SDK change |
Restored SDK version to 10.0.100-rc.1.25451.107 as requested Co-authored-by: thomhurst <[email protected]>
Done. Reverted SDK version to 10.0.100-rc.1.25451.107 in global.json (commit: will be shown after push) |
The PR adds NonPublicConstructors, NonPublicProperties, and NonPublicMethods to DynamicallyAccessedMemberTypes attributes, which changes the public API surface. This is intentional to support internal classes and properties with ClassDataSource attribute. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
Claude finished @Copilot's task —— View job PR Review Complete🎯 SummaryThis PR successfully implements support for internal classes and properties with ✅ Code Quality & Best PracticesSource Generator Changes (
Reflection Mode Updates
API Surface Changes
🧪 Test Coverage
⚡ Performance Assessment
🔒 Security Analysis
🔄 Dual-Mode Implementation
📋 Snapshot Updates
🎯 Minor Observations
🚀 RecommendationAPPROVE - This is a solid implementation that:
The PR is ready for merge once CI passes. |
Summary
Successfully implemented support for internal classes and properties with
ClassDataSourceattribute. The changes include:Source Generator (
PropertyInjectionSourceGenerator.cs)IsPubliclyAccessibleto accept both public and internal typesReflection Mode
PropertyInjectionPlanBuilder.BuildReflectionPlanto discover NonPublic propertiesReflectionAttributeExtractor.ExtractPropertyDataSourcesto discover NonPublic propertiesAPI Surface
ClassDataSourceAttributevariants (generic and non-generic) to includeDynamicallyAccessedMemberTypes.NonPublicConstructors | NonPublicProperties | NonPublicMethodsClassDataSourcesmethods with the same NonPublic member accessTesting
The implementation now allows users to mark both test classes and their
ClassDataSourceproperties as internal, addressing the reported issue.Original prompt
Fixes #3369
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.