Skip to content

Feature Enable Partial Reactive Properties to have initializer #231

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

Merged
merged 2 commits into from
May 11, 2025

Conversation

ChrisPulman
Copy link
Member

What kind of change does this PR introduce?

feature

What is the current behavior?

fixes #222

What is the new behavior?

The main feature addition is to enable Partial Reactive Properties to use initializers, the consuming project must use the Preview version of C# to enable this.

This pull request also introduces several updates and improvements to the ReactiveUI source generators, focusing on property access modifiers, code generation logic, and internal test models. The key changes include the addition of new reactive properties in test view models, updates to property access modifier handling, and enhancements to code generation syntax.

Enhancements to Property Access Modifiers:

  • Updated the PropertyInfo record to distinguish between SetAccessModifier and PropertyAccessModifier for more precise handling of property access levels. (src/ReactiveUI.SourceGenerators.Roslyn/Reactive/Models/PropertyInfo.cs, src/ReactiveUI.SourceGenerators.Roslyn/Reactive/Models/PropertyInfo.csL22-R26)
  • Refactored the ReactiveGenerator to improve the handling of SetAccessModifier and PropertyAccessModifier, ensuring proper formatting and consistency for different access levels (e.g., protected internal, private protected). (src/ReactiveUI.SourceGenerators.Roslyn/Reactive/ReactiveGenerator.Execute.cs, [1] [2] [3]

Improvements to Code Generation:

Additions to Test Models:

Miscellaneous Updates:

What might this PR break?

Please check if the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Other information:

@ChrisPulman ChrisPulman merged commit a31d58e into main May 11, 2025
1 check passed
@ChrisPulman ChrisPulman deleted the FeatureEnablePartialPropertyInitializer branch May 11, 2025 00:36
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 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.

Partial property for default value?
2 participants