Feature Enable Partial Reactive Properties to have initializer #231
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
PropertyInfo
record to distinguish betweenSetAccessModifier
andPropertyAccessModifier
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)ReactiveGenerator
to improve the handling ofSetAccessModifier
andPropertyAccessModifier
, 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:
GetPropertySyntax
method to correctly handle access modifiers and improve the generated property syntax, ensuring better alignment with the intended behavior. (src/ReactiveUI.SourceGenerators.Roslyn/Reactive/ReactiveGenerator.Execute.cs
, src/ReactiveUI.SourceGenerators.Roslyn/Reactive/ReactiveGenerator.Execute.csL318-R413)GenerateParentClassDeclarations
method to use a more concise syntax with array slicing for property parent information. (src/ReactiveUI.SourceGenerators.Roslyn/Reactive/ReactiveGenerator.Execute.cs
, src/ReactiveUI.SourceGenerators.Roslyn/Reactive/ReactiveGenerator.Execute.csL258-R313)Additions to Test Models:
public
,internal
,protected
,private
) to theInternalTestViewModel
for testing purposes. (src/ReactiveUI.SourceGenerators.Execute/InternalTestViewModel.cs
, src/ReactiveUI.SourceGenerators.Execute/InternalTestViewModel.csR1-R42)TestViewModel
to expand test coverage. (src/ReactiveUI.SourceGenerators.Execute/TestViewModel.cs
, src/ReactiveUI.SourceGenerators.Execute/TestViewModel.csR334-R336)Miscellaneous Updates:
CA1812
warning in the project file to address unused internal types during compilation. (src/ReactiveUI.SourceGenerators.Execute/ReactiveUI.SourceGenerators.Execute.csproj
, src/ReactiveUI.SourceGenerators.Execute/ReactiveUI.SourceGenerators.Execute.csprojR12)Microsoft.CodeAnalysis.CSharp
for additional syntax analysis capabilities. (src/ReactiveUI.SourceGenerators.Roslyn/Reactive/ReactiveGenerator.Execute.cs
, src/ReactiveUI.SourceGenerators.Roslyn/Reactive/ReactiveGenerator.Execute.csR11)What might this PR break?
Please check if the PR fulfills these requirements
Other information: