-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Required Init For Reactive Property
Closes #134
- Loading branch information
1 parent
45490dc
commit a271660
Showing
21 changed files
with
201 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ internal enum AccessModifier | |
Private, | ||
InternalProtected, | ||
PrivateProtected, | ||
Init, | ||
} | ||
|
||
/// <summary> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ internal enum AccessModifier | |
Private, | ||
InternalProtected, | ||
PrivateProtected, | ||
Init, | ||
} | ||
|
||
/// <summary> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ internal enum AccessModifier | |
Private, | ||
InternalProtected, | ||
PrivateProtected, | ||
Init, | ||
} | ||
|
||
/// <summary> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ internal enum AccessModifier | |
Private, | ||
InternalProtected, | ||
PrivateProtected, | ||
Init, | ||
} | ||
|
||
/// <summary> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ internal enum AccessModifier | |
Private, | ||
InternalProtected, | ||
PrivateProtected, | ||
Init, | ||
} | ||
|
||
/// <summary> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...s.FromReactivePropertiesWithInit#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs | ||
// Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for full license information. | ||
|
||
// <auto-generated/> | ||
#pragma warning disable | ||
#nullable enable | ||
namespace ReactiveUI.SourceGenerators; | ||
|
||
/// <summary> | ||
/// AccessModifier. | ||
/// </summary> | ||
internal enum AccessModifier | ||
{ | ||
Public, | ||
Protected, | ||
Internal, | ||
Private, | ||
InternalProtected, | ||
PrivateProtected, | ||
Init, | ||
} | ||
|
||
/// <summary> | ||
/// InheritanceModifier. | ||
/// </summary> | ||
internal enum InheritanceModifier | ||
{ | ||
None, | ||
Virtual, | ||
Override, | ||
New, | ||
} | ||
#nullable restore | ||
#pragma warning restore |
40 changes: 40 additions & 0 deletions
40
...romReactivePropertiesWithInit#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs | ||
// Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
|
||
// <auto-generated/> | ||
#pragma warning disable | ||
#nullable enable | ||
namespace ReactiveUI.SourceGenerators; | ||
|
||
/// <summary> | ||
/// ReactiveAttribute. | ||
/// </summary> | ||
/// <seealso cref="Attribute" /> | ||
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = false)] | ||
internal sealed class ReactiveAttribute : Attribute | ||
{ | ||
/// <summary> | ||
/// Gets the AccessModifier of the set property. | ||
/// </summary> | ||
/// <value> | ||
/// The AccessModifier of the set property. | ||
/// </value> | ||
public AccessModifier SetModifier { get; init; } | ||
|
||
/// <summary> | ||
/// Gets the InheritanceModifier of the property. | ||
/// </sumary> | ||
public InheritanceModifier Inheritance { get; init; } | ||
|
||
/// <summary> | ||
/// Use Required attribute to indicate that the property is required. | ||
/// </summary> | ||
public bool UseRequired { get; init; } | ||
} | ||
#nullable restore | ||
#pragma warning restore |
26 changes: 26 additions & 0 deletions
26
...ctiveGeneratorTests.FromReactivePropertiesWithInit#TestNs.TestVM.Properties.g.verified.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//HintName: TestNs.TestVM.Properties.g.cs | ||
// <auto-generated/> | ||
using ReactiveUI; | ||
|
||
#pragma warning disable | ||
#nullable enable | ||
|
||
namespace TestNs | ||
{ | ||
/// <summary> | ||
/// Partial class for the TestVM which contains ReactiveUI Reactive property initialization. | ||
/// </summary> | ||
public partial class TestVM | ||
{ | ||
/// <inheritdoc cref="_mustBeSet"/> | ||
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] | ||
public string MustBeSet | ||
{ | ||
get => _mustBeSet; | ||
[global::System.Diagnostics.CodeAnalysis.MemberNotNull("_mustBeSet")] | ||
set => this.RaiseAndSetIfChanged(ref _mustBeSet, value); | ||
} | ||
} | ||
} | ||
#nullable restore | ||
#pragma warning restore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ internal enum AccessModifier | |
Private, | ||
InternalProtected, | ||
PrivateProtected, | ||
Init, | ||
} | ||
|
||
/// <summary> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters