diff --git a/README.md b/README.md index 89f2686..f9986d6 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ ReactiveUI Source Generators automatically generate ReactiveUI objects to stream - `[RoutedControlHost("YourNameSpace.CustomControl")]` - `[ViewModelControlHost("YourNameSpace.CustomControl")]` - `[BindableDerivedList]` Generates a derived list from a ReadOnlyObservableCollection backing field +- `[ReactiveCollection]` Generates property changed notifications on add, remove, new actions on a ObservableCollection backing field ### Compatibility Notes - For ReactiveUI versions **older than V19.5.31**, all `[ReactiveCommand]` options are supported except for async methods with a `CancellationToken`. @@ -587,6 +588,24 @@ using ReactiveUI.SourceGenerators.WinForms; public partial class MyCustomViewModelControlHost; ``` +### ReactiveCollection +```csharp +using System.Collections.ObjectModel; +using ReactiveUI; +using ReactiveUI.SourceGenerators; + +public partial class MyReactiveClass : ReactiveObject +{ + [ReactiveCollection] + private ObservableCollection _myCollection; + + public MyReactiveClass() + { + MyCollection = new ObservableCollection(); + _myCollection.Add("Item 1"); + } +} +``` ### TODO: - Add ObservableAsProperty to generate from a IObservable method with parameters. diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 90d9172..457513a 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -10,8 +10,8 @@ - - + + @@ -21,28 +21,28 @@ - - - - - - + + + + + + - + - - - + + + - + - - + + diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/BindableDerivedListGeneratorTests.FromReactiveProperties#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/BindableDerivedListGeneratorTests.FromReactiveProperties#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs index 633ddf8..5b50001 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/BindableDerivedListGeneratorTests.FromReactiveProperties#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/BindableDerivedListGeneratorTests.FromReactiveProperties#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ReactiveAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Field, AllowMultiple = false, Inherited = false)] internal sealed class BindableDerivedListAttribute : global::System.Attribute; #nullable restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/ReactiveCollectionGeneratorTests.FromReactiveCollectionField#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/ReactiveCollectionGeneratorTests.FromReactiveCollectionField#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs new file mode 100644 index 0000000..bc8d779 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/ReactiveCollectionGeneratorTests.FromReactiveCollectionField#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs @@ -0,0 +1,21 @@ +//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.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; + +// +#pragma warning disable +#nullable enable +namespace ReactiveUI.SourceGenerators; + +/// +/// ReactiveAttribute. +/// +/// +[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = false)] +internal sealed class BindableDerivedListAttribute : Attribute; +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/IViewForGeneratorTests.FromIViewFor#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/IViewForGeneratorTests.FromIViewFor#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs new file mode 100644 index 0000000..0ad03a7 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/IViewForGeneratorTests.FromIViewFor#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs @@ -0,0 +1,34 @@ +//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.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. + +// +#pragma warning disable +#nullable enable +namespace ReactiveUI.SourceGenerators; + +/// +/// IViewForAttribute. +/// +/// +/// +/// Initializes a new instance of the class. +/// +/// Type of the view model. +[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] +internal sealed class IViewForAttribute : global::System.Attribute; + +/// +/// IViewForAttribute. +/// +/// +/// +/// Initializes a new instance of the class. +/// +/// Type of the view model. +[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] +internal sealed class IViewForAttribute(string? viewModelType) : global::System.Attribute; +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs index ffb1bb2..650a013 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ObservableAsPropertyAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property | global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] internal sealed class ObservableAsPropertyAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs index 3545edf..318d202 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs @@ -4,16 +4,13 @@ #nullable enable namespace TestNs { - /// - /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. - /// + public partial class TestVM { /// private readonly ReactiveUI.ObservableAsPropertyHelper _testPropertyHelper; /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] [global::System.Runtime.Serialization.DataMemberAttribute()] [global::System.Text.Json.Serialization.JsonIncludeAttribute()] diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableMethods#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableMethods#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs index ffb1bb2..650a013 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableMethods#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableMethods#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ObservableAsPropertyAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property | global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] internal sealed class ObservableAsPropertyAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableMethods#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableMethods#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs index 2cc29f4..3c24f8c 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableMethods#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableMethods#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs @@ -7,9 +7,7 @@ namespace TestNs { - /// - /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. - /// + public partial class TestVM { /// @@ -19,11 +17,9 @@ public partial class TestVM private ReactiveUI.ObservableAsPropertyHelper? _test2PropertyHelper; /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int Test2Property { get => _test2Property = _test2PropertyHelper?.Value ?? _test2Property; } - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] protected void InitializeOAPH() { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableMethodsWithName#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableMethodsWithName#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs index ffb1bb2..650a013 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableMethodsWithName#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableMethodsWithName#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ObservableAsPropertyAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property | global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] internal sealed class ObservableAsPropertyAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableMethodsWithName#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableMethodsWithName#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs index 4903cb9..177122c 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableMethodsWithName#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableMethodsWithName#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs @@ -7,9 +7,7 @@ namespace TestNs { - /// - /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. - /// + public partial class TestVM { /// @@ -19,11 +17,9 @@ public partial class TestVM private ReactiveUI.ObservableAsPropertyHelper? _test3PropertyHelper; /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int Test3Property { get => _test3Property = _test3PropertyHelper?.Value ?? _test3Property; } - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] protected void InitializeOAPH() { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableProp#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableProp#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs index ffb1bb2..650a013 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableProp#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableProp#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ObservableAsPropertyAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property | global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] internal sealed class ObservableAsPropertyAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableProp#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableProp#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs index 77232c1..e0b9a23 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableProp#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableProp#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs @@ -7,9 +7,7 @@ namespace TestNs { - /// - /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. - /// + public partial class TestVM { /// @@ -19,11 +17,9 @@ public partial class TestVM private ReactiveUI.ObservableAsPropertyHelper? _test1PropertyHelper; /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int Test1Property { get => _test1Property = _test1PropertyHelper?.Value ?? _test1Property; } - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] protected void InitializeOAPH() { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs index ffb1bb2..650a013 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ObservableAsPropertyAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property | global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] internal sealed class ObservableAsPropertyAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#TestNs.TestVM+TestVMInner1.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#TestNs.TestVM+TestVMInner1.ObservableAsPropertyFromObservable.g.verified.cs index 9f8006a..dca3643 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#TestNs.TestVM+TestVMInner1.ObservableAsPropertyFromObservable.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#TestNs.TestVM+TestVMInner1.ObservableAsPropertyFromObservable.g.verified.cs @@ -9,9 +9,7 @@ namespace TestNs { public partial class TestVM { -/// - /// Partial class for the TestVMInner1 which contains ReactiveUI Observable As Property initialization. - /// + public partial class TestVMInner1 { /// @@ -21,11 +19,9 @@ public partial class TestVMInner1 private ReactiveUI.ObservableAsPropertyHelper? _testIn1PropertyHelper; /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int TestIn1Property { get => _testIn1Property = _testIn1PropertyHelper?.Value ?? _testIn1Property; } - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] protected void InitializeOAPH() { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#TestNs.TestVM+TestVMInner2+TestVMInner3.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#TestNs.TestVM+TestVMInner2+TestVMInner3.ObservableAsPropertyFromObservable.g.verified.cs index c8bf60f..3c24583 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#TestNs.TestVM+TestVMInner2+TestVMInner3.ObservableAsPropertyFromObservable.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#TestNs.TestVM+TestVMInner2+TestVMInner3.ObservableAsPropertyFromObservable.g.verified.cs @@ -11,9 +11,7 @@ public partial class TestVM { public partial class TestVMInner2 { -/// - /// Partial class for the TestVMInner3 which contains ReactiveUI Observable As Property initialization. - /// + public partial class TestVMInner3 { /// @@ -23,11 +21,9 @@ public partial class TestVMInner3 private ReactiveUI.ObservableAsPropertyHelper? _testIn3PropertyHelper; /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int TestIn3Property { get => _testIn3Property = _testIn3PropertyHelper?.Value ?? _testIn3Property; } - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] protected void InitializeOAPH() { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#TestNs.TestVM+TestVMInner2.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#TestNs.TestVM+TestVMInner2.ObservableAsPropertyFromObservable.g.verified.cs index cd1cb76..b125822 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#TestNs.TestVM+TestVMInner2.ObservableAsPropertyFromObservable.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#TestNs.TestVM+TestVMInner2.ObservableAsPropertyFromObservable.g.verified.cs @@ -9,9 +9,7 @@ namespace TestNs { public partial class TestVM { -/// - /// Partial class for the TestVMInner2 which contains ReactiveUI Observable As Property initialization. - /// + public partial class TestVMInner2 { /// @@ -21,11 +19,9 @@ public partial class TestVMInner2 private ReactiveUI.ObservableAsPropertyHelper? _testIn2PropertyHelper; /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int TestIn2Property { get => _testIn2Property = _testIn2PropertyHelper?.Value ?? _testIn2Property; } - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] protected void InitializeOAPH() { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs index 77232c1..e0b9a23 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs @@ -7,9 +7,7 @@ namespace TestNs { - /// - /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. - /// + public partial class TestVM { /// @@ -19,11 +17,9 @@ public partial class TestVM private ReactiveUI.ObservableAsPropertyHelper? _test1PropertyHelper; /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int Test1Property { get => _test1Property = _test1PropertyHelper?.Value ?? _test1Property; } - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] protected void InitializeOAPH() { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttribute#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttribute#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs index ffb1bb2..650a013 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttribute#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttribute#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ObservableAsPropertyAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property | global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] internal sealed class ObservableAsPropertyAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttribute#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttribute#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs index dea9016..7b27e44 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttribute#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttribute#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs @@ -7,9 +7,7 @@ namespace TestNs { - /// - /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. - /// + public partial class TestVM { /// @@ -19,13 +17,11 @@ public partial class TestVM private ReactiveUI.ObservableAsPropertyHelper? _test5PropertyHelper; /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] [global::System.Runtime.Serialization.DataMemberAttribute()] [global::System.Text.Json.Serialization.JsonIncludeAttribute()] public int Test5Property { get => _test5Property = _test5PropertyHelper?.Value ?? _test5Property; } - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] protected void InitializeOAPH() { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttributeNullableRef#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttributeNullableRef#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs index ffb1bb2..650a013 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttributeNullableRef#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttributeNullableRef#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ObservableAsPropertyAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property | global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] internal sealed class ObservableAsPropertyAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttributeNullableRef#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttributeNullableRef#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs index 4314e38..117817b 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttributeNullableRef#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttributeNullableRef#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs @@ -7,9 +7,7 @@ namespace TestNs { - /// - /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. - /// + public partial class TestVM { /// @@ -19,13 +17,11 @@ public partial class TestVM private ReactiveUI.ObservableAsPropertyHelper? _test7PropertyHelper; /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] [global::System.Runtime.Serialization.DataMemberAttribute()] [global::System.Text.Json.Serialization.JsonIncludeAttribute()] public object? Test7Property { get => _test7Property = (_test7PropertyHelper == null ? _test7Property : _test7PropertyHelper.Value); } - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] protected void InitializeOAPH() { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttributeRef#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttributeRef#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs index ffb1bb2..650a013 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttributeRef#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttributeRef#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ObservableAsPropertyAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property | global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] internal sealed class ObservableAsPropertyAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttributeRef#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttributeRef#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs index 746f1d2..af72674 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttributeRef#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttributeRef#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs @@ -7,9 +7,7 @@ namespace TestNs { - /// - /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. - /// + public partial class TestVM { /// @@ -19,13 +17,11 @@ public partial class TestVM private ReactiveUI.ObservableAsPropertyHelper? _test6PropertyHelper; /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] [global::System.Runtime.Serialization.DataMemberAttribute()] [global::System.Text.Json.Serialization.JsonIncludeAttribute()] public object Test6Property { get => _test6Property = _test6PropertyHelper?.Value ?? _test6Property; } - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] protected void InitializeOAPH() { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithName#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithName#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs index ffb1bb2..650a013 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithName#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithName#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ObservableAsPropertyAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property | global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] internal sealed class ObservableAsPropertyAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithName#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithName#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs index 5b9f89a..bd0fb8a 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithName#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithName#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs @@ -7,9 +7,7 @@ namespace TestNs { - /// - /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. - /// + public partial class TestVM { /// @@ -19,11 +17,9 @@ public partial class TestVM private ReactiveUI.ObservableAsPropertyHelper? _test4PropertyHelper; /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int Test4Property { get => _test4Property = _test4PropertyHelper?.Value ?? _test4Property; } - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] protected void InitializeOAPH() { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromPartialProperty#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromPartialProperty#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs index ffb1bb2..650a013 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromPartialProperty#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromPartialProperty#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ObservableAsPropertyAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property | global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] internal sealed class ObservableAsPropertyAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromPartialProperty#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromPartialProperty#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs index 5ea9ac5..4befe88 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromPartialProperty#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromPartialProperty#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs @@ -7,9 +7,7 @@ namespace TestNs { - /// - /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. - /// + public partial class TestVM { /// @@ -19,12 +17,10 @@ public partial class TestVM private readonly ReactiveUI.ObservableAsPropertyHelper _testPropertyHelper; /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] [global::System.Runtime.Serialization.DataMemberAttribute()] public partial double? TestProperty { get => _testProperty = (_testPropertyHelper == null ? _testProperty : _testPropertyHelper.Value); } - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] protected void InitializeOAPH() { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs index ffb1bb2..650a013 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ObservableAsPropertyAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property | global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] internal sealed class ObservableAsPropertyAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs index a085f58..23682fa 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs @@ -4,16 +4,13 @@ #nullable enable namespace TestNs { - /// - /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. - /// + public partial class TestVM { /// private readonly ReactiveUI.ObservableAsPropertyHelper _test1Helper; /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int Test1 { get => _test1 = _test1Helper?.Value ?? _test1; } } diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs index ffb1bb2..650a013 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ObservableAsPropertyAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property | global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] internal sealed class ObservableAsPropertyAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM+TestVMInner1.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM+TestVMInner1.ObservableAsProperties.g.verified.cs index c215855..5221cb6 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM+TestVMInner1.ObservableAsProperties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM+TestVMInner1.ObservableAsProperties.g.verified.cs @@ -6,16 +6,13 @@ namespace TestNs { public partial class TestVM { -/// - /// Partial class for the TestVMInner1 which contains ReactiveUI Observable As Property initialization. - /// + public partial class TestVMInner1 { /// private readonly ReactiveUI.ObservableAsPropertyHelper _testIn1Helper; /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int TestIn1 { get => _testIn1 = _testIn1Helper?.Value ?? _testIn1; } } diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM+TestVMInner2+TestVMInner3.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM+TestVMInner2+TestVMInner3.ObservableAsProperties.g.verified.cs index cc1a445..190f193 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM+TestVMInner2+TestVMInner3.ObservableAsProperties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM+TestVMInner2+TestVMInner3.ObservableAsProperties.g.verified.cs @@ -8,16 +8,13 @@ public partial class TestVM { public partial class TestVMInner2 { -/// - /// Partial class for the TestVMInner3 which contains ReactiveUI Observable As Property initialization. - /// + public partial class TestVMInner3 { /// private readonly ReactiveUI.ObservableAsPropertyHelper _testIn3Helper; /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int TestIn3 { get => _testIn3 = _testIn3Helper?.Value ?? _testIn3; } } diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM+TestVMInner2.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM+TestVMInner2.ObservableAsProperties.g.verified.cs index d1ed9c2..d8747a9 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM+TestVMInner2.ObservableAsProperties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM+TestVMInner2.ObservableAsProperties.g.verified.cs @@ -6,16 +6,13 @@ namespace TestNs { public partial class TestVM { -/// - /// Partial class for the TestVMInner2 which contains ReactiveUI Observable As Property initialization. - /// + public partial class TestVMInner2 { /// private readonly ReactiveUI.ObservableAsPropertyHelper _testIn2Helper; /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int TestIn2 { get => _testIn2 = _testIn2Helper?.Value ?? _testIn2; } } diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM.ObservableAsProperties.g.verified.cs index 6622b1a..2897a9b 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM.ObservableAsProperties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM.ObservableAsProperties.g.verified.cs @@ -4,16 +4,13 @@ #nullable enable namespace TestNs { - /// - /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. - /// + public partial class TestVM { /// private readonly ReactiveUI.ObservableAsPropertyHelper _test2Helper; /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int Test2 { get => _test2 = _test2Helper?.Value ?? _test2; } } diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NamedFromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NamedFromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs index ffb1bb2..650a013 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NamedFromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NamedFromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ObservableAsPropertyAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property | global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] internal sealed class ObservableAsPropertyAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NamedFromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NamedFromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs index 357b22c..e96b982 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NamedFromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NamedFromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs @@ -4,16 +4,13 @@ #nullable enable namespace TestNs { - /// - /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. - /// + public partial class TestVM { /// private readonly ReactiveUI.ObservableAsPropertyHelper _test4Helper; /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int Test4 { get => _test4 = _test4Helper?.Value ?? _test4; } } diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NonReadOnlyFromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NonReadOnlyFromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs index ffb1bb2..650a013 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NonReadOnlyFromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NonReadOnlyFromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ObservableAsPropertyAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property | global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] internal sealed class ObservableAsPropertyAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NonReadOnlyFromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NonReadOnlyFromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs index de147c5..3b2b7bc 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NonReadOnlyFromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NonReadOnlyFromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs @@ -4,16 +4,13 @@ #nullable enable namespace TestNs { - /// - /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. - /// + public partial class TestVM { /// private readonly ReactiveUI.ObservableAsPropertyHelper _test3Helper; /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int Test3 { get => _test3 = _test3Helper?.Value ?? _test3; } } diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NonReadOnlyFromFieldProtected#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NonReadOnlyFromFieldProtected#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs index ffb1bb2..650a013 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NonReadOnlyFromFieldProtected#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NonReadOnlyFromFieldProtected#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ObservableAsPropertyAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property | global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] internal sealed class ObservableAsPropertyAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NonReadOnlyFromFieldProtected#TestNs.TestVM.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NonReadOnlyFromFieldProtected#TestNs.TestVM.ObservableAsProperties.g.verified.cs index dc751f1..548e82d 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NonReadOnlyFromFieldProtected#TestNs.TestVM.ObservableAsProperties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NonReadOnlyFromFieldProtected#TestNs.TestVM.ObservableAsProperties.g.verified.cs @@ -4,16 +4,13 @@ #nullable enable namespace TestNs { - /// - /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. - /// + public partial class TestVM { /// private readonly ReactiveUI.ObservableAsPropertyHelper _test5Helper; /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int Test5 { get => _test5 = _test5Helper?.Value ?? _test5; } } diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePartialProperties#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePartialProperties#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs index 742383d..d4c80bd 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePartialProperties#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePartialProperties#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ReactiveAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property, AllowMultiple = false, Inherited = false)] internal sealed class ReactiveAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactiveProperiesWithAttributes#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactiveProperiesWithAttributes#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs index 742383d..d4c80bd 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactiveProperiesWithAttributes#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactiveProperiesWithAttributes#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ReactiveAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property, AllowMultiple = false, Inherited = false)] internal sealed class ReactiveAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactiveProperiesWithAttributes#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactiveProperiesWithAttributes#TestNs.TestVM.Properties.g.verified.cs index 8df0017..cd0ffd2 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactiveProperiesWithAttributes#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactiveProperiesWithAttributes#TestNs.TestVM.Properties.g.verified.cs @@ -7,14 +7,11 @@ namespace TestNs { - /// - /// Partial class for the TestVM which contains ReactiveUI Reactive property initialization. - /// + public partial class TestVM { /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] [global::System.Runtime.Serialization.DataMemberAttribute()] [global::System.Text.Json.Serialization.JsonIncludeAttribute()] diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactiveProperties#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactiveProperties#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs index 742383d..d4c80bd 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactiveProperties#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactiveProperties#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ReactiveAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property, AllowMultiple = false, Inherited = false)] internal sealed class ReactiveAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactiveProperties#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactiveProperties#TestNs.TestVM.Properties.g.verified.cs index 2fcae35..49b034f 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactiveProperties#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactiveProperties#TestNs.TestVM.Properties.g.verified.cs @@ -7,14 +7,11 @@ namespace TestNs { - /// - /// Partial class for the TestVM which contains ReactiveUI Reactive property initialization. - /// + public partial class TestVM { /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int Test1 { diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesCalledValue#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesCalledValue#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs index 742383d..d4c80bd 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesCalledValue#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesCalledValue#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ReactiveAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property, AllowMultiple = false, Inherited = false)] internal sealed class ReactiveAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesCalledValue#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesCalledValue#TestNs.TestVM.Properties.g.verified.cs index d117787..283ab8d 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesCalledValue#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesCalledValue#TestNs.TestVM.Properties.g.verified.cs @@ -7,14 +7,11 @@ namespace TestNs { - /// - /// Partial class for the TestVM which contains ReactiveUI Reactive property initialization. - /// + public partial class TestVM { /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public string Value { diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithAccess#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithAccess#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs index 742383d..d4c80bd 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithAccess#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithAccess#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ReactiveAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property, AllowMultiple = false, Inherited = false)] internal sealed class ReactiveAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithAccess#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithAccess#TestNs.TestVM.Properties.g.verified.cs index 87ff021..89940cb 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithAccess#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithAccess#TestNs.TestVM.Properties.g.verified.cs @@ -7,14 +7,11 @@ namespace TestNs { - /// - /// Partial class for the TestVM which contains ReactiveUI Reactive property initialization. - /// + public partial class TestVM { /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int Test2 { diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithAttributesAccessAndInheritance#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithAttributesAccessAndInheritance#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs index 742383d..d4c80bd 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithAttributesAccessAndInheritance#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithAttributesAccessAndInheritance#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ReactiveAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property, AllowMultiple = false, Inherited = false)] internal sealed class ReactiveAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithAttributesAccessAndInheritance#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithAttributesAccessAndInheritance#TestNs.TestVM.Properties.g.verified.cs index a3601a2..92267be 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithAttributesAccessAndInheritance#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithAttributesAccessAndInheritance#TestNs.TestVM.Properties.g.verified.cs @@ -7,14 +7,11 @@ namespace TestNs { - /// - /// Partial class for the TestVM which contains ReactiveUI Reactive property initialization. - /// + public partial class TestVM { /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] [global::System.Runtime.Serialization.DataMemberAttribute()] [global::System.Text.Json.Serialization.JsonIncludeAttribute()] diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithIdenticalClass#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithIdenticalClass#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs index 742383d..d4c80bd 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithIdenticalClass#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithIdenticalClass#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ReactiveAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property, AllowMultiple = false, Inherited = false)] internal sealed class ReactiveAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithIdenticalClass#TestNs1.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithIdenticalClass#TestNs1.TestVM.Properties.g.verified.cs index 283ca47..0e7ba6b 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithIdenticalClass#TestNs1.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithIdenticalClass#TestNs1.TestVM.Properties.g.verified.cs @@ -7,14 +7,11 @@ namespace TestNs1 { - /// - /// Partial class for the TestVM which contains ReactiveUI Reactive property initialization. - /// + public partial class TestVM { /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] [global::System.Runtime.Serialization.DataMemberAttribute()] [global::System.Text.Json.Serialization.JsonIncludeAttribute()] diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithIdenticalClass#TestNs2.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithIdenticalClass#TestNs2.TestVM.Properties.g.verified.cs index f260ef9..f27308e 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithIdenticalClass#TestNs2.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithIdenticalClass#TestNs2.TestVM.Properties.g.verified.cs @@ -7,14 +7,11 @@ namespace TestNs2 { - /// - /// Partial class for the TestVM which contains ReactiveUI Reactive property initialization. - /// + public partial class TestVM { /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] [global::System.Runtime.Serialization.DataMemberAttribute()] [global::System.Text.Json.Serialization.JsonIncludeAttribute()] diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithInit#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithInit#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs index 742383d..d4c80bd 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithInit#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithInit#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ReactiveAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property, AllowMultiple = false, Inherited = false)] internal sealed class ReactiveAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithInit#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithInit#TestNs.TestVM.Properties.g.verified.cs index 5d39a64..f1b9a0e 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithInit#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithInit#TestNs.TestVM.Properties.g.verified.cs @@ -7,14 +7,11 @@ namespace TestNs { - /// - /// Partial class for the TestVM which contains ReactiveUI Reactive property initialization. - /// + public partial class TestVM { /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public string MustBeSet { diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs index 742383d..d4c80bd 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ReactiveAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property, AllowMultiple = false, Inherited = false)] internal sealed class ReactiveAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#TestNs1.TestViewModel3+TestInnerClass1.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#TestNs1.TestViewModel3+TestInnerClass1.Properties.g.verified.cs index cba3017..f716a5c 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#TestNs1.TestViewModel3+TestInnerClass1.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#TestNs1.TestViewModel3+TestInnerClass1.Properties.g.verified.cs @@ -9,14 +9,11 @@ namespace TestNs1 { public partial class TestViewModel3 { -/// - /// Partial class for the TestInnerClass1 which contains ReactiveUI Reactive property initialization. - /// + public partial class TestInnerClass1 { /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int TestInner1 { @@ -26,7 +23,6 @@ public int TestInner1 } /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int TestInner11 { diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#TestNs1.TestViewModel3+TestInnerClass2+TestInnerClass3.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#TestNs1.TestViewModel3+TestInnerClass2+TestInnerClass3.Properties.g.verified.cs index ea35477..21bede2 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#TestNs1.TestViewModel3+TestInnerClass2+TestInnerClass3.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#TestNs1.TestViewModel3+TestInnerClass2+TestInnerClass3.Properties.g.verified.cs @@ -11,14 +11,11 @@ public partial class TestViewModel3 { public partial class TestInnerClass2 { -/// - /// Partial class for the TestInnerClass3 which contains ReactiveUI Reactive property initialization. - /// + public partial class TestInnerClass3 { /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int TestInner3 { @@ -28,7 +25,6 @@ public int TestInner3 } /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int TestInner33 { diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#TestNs1.TestViewModel3+TestInnerClass2.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#TestNs1.TestViewModel3+TestInnerClass2.Properties.g.verified.cs index da67e7b..ba38f3a 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#TestNs1.TestViewModel3+TestInnerClass2.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#TestNs1.TestViewModel3+TestInnerClass2.Properties.g.verified.cs @@ -9,14 +9,11 @@ namespace TestNs1 { public partial class TestViewModel3 { -/// - /// Partial class for the TestInnerClass2 which contains ReactiveUI Reactive property initialization. - /// + public partial class TestInnerClass2 { /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int TestInner2 { @@ -26,7 +23,6 @@ public int TestInner2 } /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int TestInner22 { diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#TestNs1.TestViewModel3.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#TestNs1.TestViewModel3.Properties.g.verified.cs index 4770f0d..898c290 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#TestNs1.TestViewModel3.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#TestNs1.TestViewModel3.Properties.g.verified.cs @@ -7,14 +7,11 @@ namespace TestNs1 { - /// - /// Partial class for the TestViewModel3 which contains ReactiveUI Reactive property initialization. - /// + public partial class TestViewModel3 { /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public float TestVM3Property { @@ -24,7 +21,6 @@ public float TestVM3Property } /// - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.2.0.0")] [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public float TestVM3Property2 { diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveAsyncCommand#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveAsyncCommand#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs index 392c75c..5009b3a 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveAsyncCommand#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveAsyncCommand#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ReativeCommandAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveCommandGenerator", "1.1.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] internal sealed class ReactiveCommandAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveAsyncCommandWithParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveAsyncCommandWithParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs index 392c75c..5009b3a 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveAsyncCommandWithParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveAsyncCommandWithParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ReativeCommandAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveCommandGenerator", "1.1.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] internal sealed class ReactiveCommandAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveCommand#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveCommand#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs index 392c75c..5009b3a 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveCommand#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveCommand#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ReativeCommandAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveCommandGenerator", "1.1.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] internal sealed class ReactiveCommandAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveCommandWithNestedClasses#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveCommandWithNestedClasses#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs index 392c75c..5009b3a 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveCommandWithNestedClasses#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveCommandWithNestedClasses#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ReativeCommandAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveCommandGenerator", "1.1.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] internal sealed class ReactiveCommandAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveCommandWithOutputScheduler#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveCommandWithOutputScheduler#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs index 392c75c..5009b3a 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveCommandWithOutputScheduler#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveCommandWithOutputScheduler#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ReativeCommandAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveCommandGenerator", "1.1.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] internal sealed class ReactiveCommandAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveCommandWithParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveCommandWithParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs index 392c75c..5009b3a 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveCommandWithParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveCommandWithParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs @@ -13,7 +13,6 @@ namespace ReactiveUI.SourceGenerators; /// ReativeCommandAttribute. /// /// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveCommandGenerator", "1.1.0.0")] [global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] internal sealed class ReactiveCommandAttribute : global::System.Attribute { diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/ReactiveCollectionGeneratorTests.FromReactiveCollectionField#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/ReactiveCollectionGeneratorTests.FromReactiveCollectionField#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs new file mode 100644 index 0000000..eeef935 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/ReactiveCollectionGeneratorTests.FromReactiveCollectionField#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs @@ -0,0 +1,19 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.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. + +// +#pragma warning disable +#nullable enable +namespace ReactiveUI.SourceGenerators; + +/// +/// ReactiveAttribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCollectionAttribute : global::System.Attribute; +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/ReactiveCollectionGeneratorTests.FromReactiveCollectionField#TestNs.TestVM.ReactiveCollections.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/ReactiveCollectionGeneratorTests.FromReactiveCollectionField#TestNs.TestVM.ReactiveCollections.g.verified.cs new file mode 100644 index 0000000..52dbc41 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/ReactiveCollectionGeneratorTests.FromReactiveCollectionField#TestNs.TestVM.ReactiveCollections.g.verified.cs @@ -0,0 +1,42 @@ +//HintName: TestNs.TestVM.ReactiveCollections.g.cs +// +using ReactiveUI; + +#pragma warning disable +#nullable enable +namespace TestNs +{ + + public partial class TestVM + { + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public global::System.Collections.ObjectModel.ObservableCollection? PublicObservableCollectionTest + { + get => _publicObservableCollectionTest; + set + { + if (value == null) + { + PublicObservableCollectionTest.CollectionChanged -= CollectionChanged(this, nameof(PublicObservableCollectionTest)); + } + + _publicObservableCollectionTest = value; + this.RaisePropertyChanged(nameof(PublicObservableCollectionTest)); + + if (_publicObservableCollectionTest != null) + { + // Remove the old handler if it exists + PublicObservableCollectionTest.CollectionChanged -= CollectionChanged(this, nameof(PublicObservableCollectionTest)); + + PublicObservableCollectionTest.CollectionChanged += CollectionChanged(this, nameof(PublicObservableCollectionTest)); + } + } + } + + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + private static global::System.Collections.Specialized.NotifyCollectionChangedEventHandler CollectionChanged(IReactiveObject @this, string propName)=> (_, _) => @this.RaisePropertyChanged(propName); + } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/ReactiveUI.SourceGenerators.Tests.csproj b/src/ReactiveUI.SourceGenerator.Tests/ReactiveUI.SourceGenerators.Tests.csproj index 02ad820..dbcb328 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/ReactiveUI.SourceGenerators.Tests.csproj +++ b/src/ReactiveUI.SourceGenerator.Tests/ReactiveUI.SourceGenerators.Tests.csproj @@ -40,6 +40,7 @@ + diff --git a/src/ReactiveUI.SourceGenerator.Tests/TestHelper.cs b/src/ReactiveUI.SourceGenerator.Tests/TestHelper.cs index 8e68843..395c7be 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/TestHelper.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/TestHelper.cs @@ -91,6 +91,7 @@ public string VerifiedFilePath() nameof(RoutedControlHostGenerator) => "ROUTEDHOST", nameof(ViewModelControlHostGenerator) => "CONTROLHOST", nameof(BindableDerivedListGenerator) => "DERIVEDLIST", + nameof(ReactiveCollectionGenerator) => "REACTIVECOLL", _ => name, }; } @@ -236,5 +237,5 @@ public SettingsTask RunGeneratorAndCheck( return VerifyGenerator(driver.RunGenerators(compilation)); } - private SettingsTask VerifyGenerator(GeneratorDriver driver) => Verify(driver).UseDirectory(VerifiedFilePath()); ////.ScrubLinesContaining("[global::System.CodeDom.Compiler.GeneratedCode(\""); + private SettingsTask VerifyGenerator(GeneratorDriver driver) => Verify(driver).UseDirectory(VerifiedFilePath()).ScrubLinesContaining("[global::System.CodeDom.Compiler.GeneratedCode(\""); } diff --git a/src/ReactiveUI.SourceGenerator.Tests/UnitTests/IViewForGeneratorTests.cs b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/IViewForGeneratorTests.cs new file mode 100644 index 0000000..b1001cd --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/IViewForGeneratorTests.cs @@ -0,0 +1,57 @@ +// Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. +// Licensed to the ReactiveUI and contributors under one or more agreements. +// The ReactiveUI and contributors licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using ReactiveUI.SourceGenerators; +using Xunit.Abstractions; + +namespace ReactiveUI.SourceGenerator.Tests; + +/// +/// IViewForGeneratorTests. +/// +public class IViewForGeneratorTests(ITestOutputHelper output) : TestBase(output) +{ + /// + /// Tests that the source generator correctly generates reactive properties. + /// + /// A task to monitor the async. + [Fact] + public Task FromIViewFor() + { + // Arrange: Setup the source code that matches the generator input expectations. + const string sourceCode = """ + using System.Collections.ObjectModel; + using ReactiveUI; + using ReactiveUI.SourceGenerators; + + namespace TestNs; + + [IViewFor] + public partial class TestViewWpf : Window + { + /// + /// Initializes a new instance of the class. + /// + public TestViewWpf() => ViewModel = TestViewModel.Instance; + } + + public partial class TestViewModel : ReactiveObject + { + /// + /// Gets the instance of the test view model. + /// + public static TestViewModel Instance { get; } = new(); + + /// + /// Gets or sets the test property. + /// + public int TestProperty { get; set; } + } + """; + + // Act: Initialize the helper and run the generator. Assert: Verify the generated code. + return TestHelper.TestPass(sourceCode); + } +} diff --git a/src/ReactiveUI.SourceGenerator.Tests/UnitTests/ReactiveCollectionGeneratorTests.cs b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/ReactiveCollectionGeneratorTests.cs new file mode 100644 index 0000000..233ecac --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/ReactiveCollectionGeneratorTests.cs @@ -0,0 +1,40 @@ +// Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. +// Licensed to the ReactiveUI and contributors under one or more agreements. +// The ReactiveUI and contributors licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using ReactiveUI.SourceGenerator.Tests; +using Xunit.Abstractions; + +namespace ReactiveUI.SourceGenerators.Tests; +/// +/// ReactiveCollectionGeneratorTests. +/// +public class ReactiveCollectionGeneratorTests(ITestOutputHelper output) : TestBase(output) +{ + /// + /// Tests that the source generator correctly generates reactive properties. + /// + /// A task to monitor the async. + [Fact] + public Task FromReactiveCollectionField() + { + // Arrange: Setup the source code that matches the generator input expectations. + const string sourceCode = """ + using System.Collections.ObjectModel; + using ReactiveUI; + using ReactiveUI.SourceGenerators; + + namespace TestNs; + + public partial class TestVM : ReactiveObject + { + [ReactiveCollection] + private ObservableCollection? _publicObservableCollectionTest; + } + """; + + // Act: Initialize the helper and run the generator. Assert: Verify the generated code. + return TestHelper.TestPass(sourceCode); + } +} diff --git a/src/ReactiveUI.SourceGenerators.Execute/InternalTestViewModel.cs b/src/ReactiveUI.SourceGenerators.Execute/InternalTestViewModel.cs index e6c8a19..2a179e6 100644 --- a/src/ReactiveUI.SourceGenerators.Execute/InternalTestViewModel.cs +++ b/src/ReactiveUI.SourceGenerators.Execute/InternalTestViewModel.cs @@ -3,6 +3,7 @@ // The ReactiveUI and contributors licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Collections.ObjectModel; using ReactiveUI; using ReactiveUI.SourceGenerators; @@ -10,6 +11,32 @@ namespace SGReactiveUI.SourceGenerators.Test; internal partial class InternalTestViewModel : ReactiveObject { + [ReactiveCollection] + private ObservableCollection? _publicObservableCollectionTest; + + public InternalTestViewModel() + { + // observe property changes + Changed + .Subscribe(x => + { + // handle property changes + if (x.PropertyName == nameof(PublicObservableCollectionTest)) + { + Console.WriteLine($"PublicObservableCollectionTest changed: {PublicObservableCollectionTest?.Count}"); + } + }); + PublicObservableCollectionTest = []; + PublicObservableCollectionTest.Add(1); + PublicObservableCollectionTest.Add(2); + PublicObservableCollectionTest.Add(3); + PublicObservableCollectionTest = null; + PublicObservableCollectionTest = []; + PublicObservableCollectionTest.Add(1); + PublicObservableCollectionTest.Add(2); + PublicObservableCollectionTest.Add(3); + } + [Reactive] public partial int PublicPartialPropertyTest { get; set; } @@ -31,6 +58,9 @@ internal partial class InternalTestViewModel : ReactiveObject [Reactive] public partial int PublicPartialPropertyWithPrivateTest { get; private set; } + [Reactive] + public partial string PublicPartialStringPropertyTest { get; set; } = "initial"; + [Reactive] internal partial int InternalPartialPropertyTest { get; set; } diff --git a/src/ReactiveUI.SourceGenerators.Execute/ReactiveUI.SourceGenerators.Execute.csproj b/src/ReactiveUI.SourceGenerators.Execute/ReactiveUI.SourceGenerators.Execute.csproj index b7cc858..2bdda74 100644 --- a/src/ReactiveUI.SourceGenerators.Execute/ReactiveUI.SourceGenerators.Execute.csproj +++ b/src/ReactiveUI.SourceGenerators.Execute/ReactiveUI.SourceGenerators.Execute.csproj @@ -8,7 +8,7 @@ true enable false - 13.0 + preview $(NoWarn);CA1812 A MVVM framework that integrates with the Reactive Extensions for .NET to create elegant, testable User Interfaces that run on any mobile or desktop platform. This is the Source Generators package for ReactiveUI diff --git a/src/ReactiveUI.SourceGenerators.Execute/TestViewModel.cs b/src/ReactiveUI.SourceGenerators.Execute/TestViewModel.cs index 2cdf27d..502e098 100644 --- a/src/ReactiveUI.SourceGenerators.Execute/TestViewModel.cs +++ b/src/ReactiveUI.SourceGenerators.Execute/TestViewModel.cs @@ -87,7 +87,7 @@ public partial class TestViewModel : ReactiveObject, IActivatableViewModel, IDis [SetsRequiredMembers] public TestViewModel() { - var internalTestViewModel = new InternalTestViewModel() { PublicRequiredPartialPropertyTest = true }; + var itv = new InternalTestViewModel { PublicRequiredPartialPropertyTest = true }; MustBeSet = "Test"; this.WhenActivated(disposables => { diff --git a/src/ReactiveUI.SourceGenerators.Roslyn/BindableDerivedList/BindableDerivedListGenerator.Execute.cs b/src/ReactiveUI.SourceGenerators.Roslyn/BindableDerivedList/BindableDerivedListGenerator.Execute.cs index 763f522..e78481f 100644 --- a/src/ReactiveUI.SourceGenerators.Roslyn/BindableDerivedList/BindableDerivedListGenerator.Execute.cs +++ b/src/ReactiveUI.SourceGenerators.Roslyn/BindableDerivedList/BindableDerivedListGenerator.Execute.cs @@ -150,9 +150,7 @@ private static string GenerateClassWithProperties(string containingTypeName, str return $$""" -/// - /// Partial class for the {{containingTypeName}} which contains ReactiveUI Reactive property initialization. - /// + {{containingClassVisibility}} partial {{containingType}} {{containingTypeName}} { [global::System.CodeDom.Compiler.GeneratedCode("{{GeneratorName}}", "{{GeneratorVersion}}")] diff --git a/src/ReactiveUI.SourceGenerators.Roslyn/IViewFor/IViewForGenerator.Execute.cs b/src/ReactiveUI.SourceGenerators.Roslyn/IViewFor/IViewForGenerator.Execute.cs index aca537b..2043645 100644 --- a/src/ReactiveUI.SourceGenerators.Roslyn/IViewFor/IViewForGenerator.Execute.cs +++ b/src/ReactiveUI.SourceGenerators.Roslyn/IViewFor/IViewForGenerator.Execute.cs @@ -266,9 +266,6 @@ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs chang namespace {{containingNamespace}} { - /// - /// Partial class for the {{containingTypeName}} which contains ReactiveUI IViewFor initialization. - /// {{forwardedAttributesString}} {{containingClassVisibility}} partial {{containingType}} {{containingTypeName}} : IViewFor<{{iviewForInfo.ViewModelTypeName}}> { diff --git a/src/ReactiveUI.SourceGenerators.Roslyn/ObservableAsProperty/ObservableAsPropertyGenerator{FromField}.Execute.cs b/src/ReactiveUI.SourceGenerators.Roslyn/ObservableAsProperty/ObservableAsPropertyGenerator{FromField}.Execute.cs index ee7df38..dd92d21 100644 --- a/src/ReactiveUI.SourceGenerators.Roslyn/ObservableAsProperty/ObservableAsPropertyGenerator{FromField}.Execute.cs +++ b/src/ReactiveUI.SourceGenerators.Roslyn/ObservableAsProperty/ObservableAsPropertyGenerator{FromField}.Execute.cs @@ -165,9 +165,7 @@ private static string GenerateClassWithProperties(string containingTypeName, str return $$""" -/// - /// Partial class for the {{containingTypeName}} which contains ReactiveUI Observable As Property initialization. - /// + {{containingClassVisibility}} partial {{containingType}} {{containingTypeName}} { {{propertyDeclarations}} diff --git a/src/ReactiveUI.SourceGenerators.Roslyn/ObservableAsProperty/ObservableAsPropertyGenerator{FromObservable}.Execute.cs b/src/ReactiveUI.SourceGenerators.Roslyn/ObservableAsProperty/ObservableAsPropertyGenerator{FromObservable}.Execute.cs index 2c412b2..9a4a062 100644 --- a/src/ReactiveUI.SourceGenerators.Roslyn/ObservableAsProperty/ObservableAsPropertyGenerator{FromObservable}.Execute.cs +++ b/src/ReactiveUI.SourceGenerators.Roslyn/ObservableAsProperty/ObservableAsPropertyGenerator{FromObservable}.Execute.cs @@ -290,9 +290,7 @@ private static string GenerateClassWithProperties(string containingTypeName, str return $$""" -/// - /// Partial class for the {{containingTypeName}} which contains ReactiveUI Observable As Property initialization. - /// + {{containingClassVisibility}} partial {{containingType}} {{containingTypeName}} { {{propertyDeclarations}} diff --git a/src/ReactiveUI.SourceGenerators.Roslyn/Reactive/ReactiveGenerator.Execute.cs b/src/ReactiveUI.SourceGenerators.Roslyn/Reactive/ReactiveGenerator.Execute.cs index 3cf3921..9424d57 100644 --- a/src/ReactiveUI.SourceGenerators.Roslyn/Reactive/ReactiveGenerator.Execute.cs +++ b/src/ReactiveUI.SourceGenerators.Roslyn/Reactive/ReactiveGenerator.Execute.cs @@ -346,9 +346,7 @@ private static string GenerateClassWithProperties(string containingTypeName, str return $$""" -/// - /// Partial class for the {{containingTypeName}} which contains ReactiveUI Reactive property initialization. - /// + {{containingClassVisibility}} partial {{containingType}} {{containingTypeName}} { {{propertyDeclarations}} diff --git a/src/ReactiveUI.SourceGenerators.Roslyn/ReactiveCollection/Models/ReactiveCollectionFieldInfo.cs b/src/ReactiveUI.SourceGenerators.Roslyn/ReactiveCollection/Models/ReactiveCollectionFieldInfo.cs new file mode 100644 index 0000000..28cbc66 --- /dev/null +++ b/src/ReactiveUI.SourceGenerators.Roslyn/ReactiveCollection/Models/ReactiveCollectionFieldInfo.cs @@ -0,0 +1,22 @@ +// Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. +// Licensed to the ReactiveUI and contributors under one or more agreements. +// The ReactiveUI and contributors licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using ReactiveUI.SourceGenerators.Helpers; +using ReactiveUI.SourceGenerators.Models; + +namespace ReactiveUI.SourceGenerators.Reactive.Models; + +/// +/// A model with gathered info on a given field. +/// +internal sealed record ReactiveCollectionFieldInfo( + TargetInfo TargetInfo, + string TypeNameWithNullabilityAnnotations, + string FieldName, + string PropertyName, + string? Initializer, + bool IsReferenceTypeOrUnconstrainedTypeParameter, + bool IncludeMemberNotNullOnSetAccessor, + EquatableArray ForwardedAttributes); diff --git a/src/ReactiveUI.SourceGenerators.Roslyn/ReactiveCollection/ReactiveCollectionGenerator.Execute.cs b/src/ReactiveUI.SourceGenerators.Roslyn/ReactiveCollection/ReactiveCollectionGenerator.Execute.cs new file mode 100644 index 0000000..b6dd406 --- /dev/null +++ b/src/ReactiveUI.SourceGenerators.Roslyn/ReactiveCollection/ReactiveCollectionGenerator.Execute.cs @@ -0,0 +1,191 @@ +// Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. +// Licensed to the ReactiveUI and contributors under one or more agreements. +// The ReactiveUI and contributors licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System; +using System.Collections.Immutable; +using System.Linq; +using System.Threading; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using ReactiveUI.SourceGenerators.Extensions; +using ReactiveUI.SourceGenerators.Helpers; +using ReactiveUI.SourceGenerators.Models; +using ReactiveUI.SourceGenerators.Reactive.Models; +using static ReactiveUI.SourceGenerators.Diagnostics.DiagnosticDescriptors; + +namespace ReactiveUI.SourceGenerators; + +/// +/// ReactiveCollectionGenerator. +/// +public sealed partial class ReactiveCollectionGenerator +{ + private static Result? GetVariableInfo(in GeneratorAttributeSyntaxContext context, CancellationToken token) + { + using var builder = ImmutableArrayBuilder.Rent(); + var symbol = context.TargetSymbol; + token.ThrowIfCancellationRequested(); + + // Skip symbols without the target attribute + if (!symbol.TryGetAttributeWithFullyQualifiedMetadataName(AttributeDefinitions.ReactiveCollectionAttributeType, out var attributeData)) + { + return default; + } + + if (symbol is not IFieldSymbol fieldSymbol) + { + return default; + } + + // Validate the target type + if (!fieldSymbol.IsTargetTypeValid()) + { + builder.Add( + InvalidReactiveObjectError, + fieldSymbol, + fieldSymbol.ContainingType, + fieldSymbol.Name); + return new(default, builder.ToImmutable()); + } + + token.ThrowIfCancellationRequested(); + + // Get the property type and name + var typeNameWithNullabilityAnnotations = fieldSymbol.Type.GetFullyQualifiedNameWithNullabilityAnnotations(); + var fieldName = fieldSymbol.Name; + var propertyName = fieldSymbol.GetGeneratedPropertyName(); + + // Check for name collisions + if (fieldName == propertyName) + { + builder.Add( + ReactivePropertyNameCollisionError, + fieldSymbol, + fieldSymbol.ContainingType, + fieldSymbol.Name); + return new(default, builder.ToImmutable()); + } + + var fieldDeclaration = (FieldDeclarationSyntax)context.TargetNode.Parent!.Parent!; + var initializer = fieldDeclaration.Declaration.Variables.FirstOrDefault()?.Initializer?.ToFullString(); + + token.ThrowIfCancellationRequested(); + + context.GetForwardedAttributes( + builder, + fieldSymbol, + fieldDeclaration.AttributeLists, + token, + out var forwardedPropertyAttributes); + + token.ThrowIfCancellationRequested(); + + // Get the nullability info for the property + fieldSymbol.GetNullabilityInfo( + context.SemanticModel, + out var isReferenceTypeOrUnconstraindTypeParameter, + out var includeMemberNotNullOnSetAccessor); + + token.ThrowIfCancellationRequested(); + + // Get the containing type info + var targetInfo = TargetInfo.From(fieldSymbol.ContainingType); + + return new( + new( + targetInfo, + typeNameWithNullabilityAnnotations, + fieldName, + propertyName, + initializer, + isReferenceTypeOrUnconstraindTypeParameter, + includeMemberNotNullOnSetAccessor, + forwardedPropertyAttributes), + builder.ToImmutable()); + } + + private static string GenerateSource(string containingTypeName, string containingNamespace, string containingClassVisibility, string containingType, ReactiveCollectionFieldInfo[] properties) + { + // Get Parent class details from properties.ParentInfo + var (parentClassDeclarationsString, closingBrackets) = TargetInfo.GenerateParentClassDeclarations([.. properties.Select(p => p.TargetInfo.ParentInfo)]); + + var classes = GenerateClassWithProperties(containingTypeName, containingNamespace, containingClassVisibility, containingType, properties); + + return $$""" +// +using ReactiveUI; + +#pragma warning disable +#nullable enable +namespace {{containingNamespace}} +{ + {{parentClassDeclarationsString}}{{classes}}{{closingBrackets}} +} +#nullable restore +#pragma warning restore +"""; + } + + /// + /// Generates the source code. + /// + /// The contain type name. + /// The containing namespace. + /// The containing class visibility. + /// The containing type. + /// The properties. + /// The value. + private static string GenerateClassWithProperties(string containingTypeName, string containingNamespace, string containingClassVisibility, string containingType, ReactiveCollectionFieldInfo[] properties) + { + // Includes 2 tabs from the property declarations so no need to add them here. + var propertyDeclarations = string.Join("\n", properties.Select(GetPropertySyntax)); + + return +$$""" + + {{containingClassVisibility}} partial {{containingType}} {{containingTypeName}} + { + [global::System.CodeDom.Compiler.GeneratedCode("{{GeneratorName}}", "{{GeneratorVersion}}")] +{{propertyDeclarations}} + + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + private static global::System.Collections.Specialized.NotifyCollectionChangedEventHandler CollectionChanged(IReactiveObject @this, string propName)=> (_, _) => @this.RaisePropertyChanged(propName); + } +"""; + } + + private static string GetPropertySyntax(ReactiveCollectionFieldInfo propertyInfo) + { + var propertyAttributes = string.Join("\n ", AttributeDefinitions.ExcludeFromCodeCoverage.Concat(propertyInfo.ForwardedAttributes)); + + return $$""" + /// + {{propertyAttributes}} + public {{propertyInfo.TypeNameWithNullabilityAnnotations}} {{propertyInfo.PropertyName}} + { + get => {{propertyInfo.FieldName}}; + set + { + if (value == null) + { + {{propertyInfo.PropertyName}}.CollectionChanged -= CollectionChanged(this, nameof({{propertyInfo.PropertyName}})); + } + + {{propertyInfo.FieldName}} = value; + this.RaisePropertyChanged(nameof({{propertyInfo.PropertyName}})); + + if ({{propertyInfo.FieldName}} != null) + { + // Remove the old handler if it exists + {{propertyInfo.PropertyName}}.CollectionChanged -= CollectionChanged(this, nameof({{propertyInfo.PropertyName}})); + + {{propertyInfo.PropertyName}}.CollectionChanged += CollectionChanged(this, nameof({{propertyInfo.PropertyName}})); + } + } + } +"""; + } +} diff --git a/src/ReactiveUI.SourceGenerators.Roslyn/ReactiveCollection/ReactiveCollectionGenerator.cs b/src/ReactiveUI.SourceGenerators.Roslyn/ReactiveCollection/ReactiveCollectionGenerator.cs new file mode 100644 index 0000000..5114905 --- /dev/null +++ b/src/ReactiveUI.SourceGenerators.Roslyn/ReactiveCollection/ReactiveCollectionGenerator.cs @@ -0,0 +1,85 @@ +// Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. +// Licensed to the ReactiveUI and contributors under one or more agreements. +// The ReactiveUI and contributors licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System.Collections.Immutable; +using System.Linq; +using System.Text; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.CodeAnalysis.Text; +using ReactiveUI.SourceGenerators.Helpers; + +namespace ReactiveUI.SourceGenerators; + +/// +/// A source generator for generating reative properties. +/// +[Generator(LanguageNames.CSharp)] +public sealed partial class ReactiveCollectionGenerator : IIncrementalGenerator +{ + internal static readonly string GeneratorName = typeof(ReactiveCollectionGenerator).FullName!; + internal static readonly string GeneratorVersion = typeof(ReactiveCollectionGenerator).Assembly.GetName().Version.ToString(); + + /// + public void Initialize(IncrementalGeneratorInitializationContext context) + { + context.RegisterPostInitializationOutput(ctx => + { + // Add the ReactiveAttribute to the compilation + ctx.AddSource($"{AttributeDefinitions.ReactiveCollectionAttributeType}.g.cs", SourceText.From(AttributeDefinitions.ReactiveCollectionAttribute, Encoding.UTF8)); + }); + + RunReactiveCollectionFromField(context); + } + + private static void RunReactiveCollectionFromField(IncrementalGeneratorInitializationContext context) + { + var propertyInfo = + context.SyntaxProvider + .ForAttributeWithMetadataName( + AttributeDefinitions.ReactiveCollectionAttributeType, + static (node, _) => node is VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax { Parent: FieldDeclarationSyntax { Parent: ClassDeclarationSyntax or RecordDeclarationSyntax, AttributeLists.Count: > 0 } } }, + static (context, token) => GetVariableInfo(context, token)) + .Where(x => x != null) + .Select((x, _) => x!) + .Collect(); + + // Generate the requested properties and methods + context.RegisterSourceOutput(propertyInfo, static (context, input) => + { + foreach (var diagnostic in input.SelectMany(static x => x.Errors)) + { + // Output the diagnostics + context.ReportDiagnostic(diagnostic.ToDiagnostic()); + } + + // Gather all the properties that are valid and group them by the target information. + var groupedPropertyInfo = input + .Where(static x => x.Value != null) + .Select(static x => x.Value!).GroupBy( + static info => (info.TargetInfo.FileHintName, info.TargetInfo.TargetName, info.TargetInfo.TargetNamespace, info.TargetInfo.TargetVisibility, info.TargetInfo.TargetType), + static info => info) + .ToImmutableArray(); + + if (groupedPropertyInfo.Length == 0) + { + return; + } + + foreach (var grouping in groupedPropertyInfo) + { + var items = grouping.ToImmutableArray(); + + if (items.Length == 0) + { + continue; + } + + var source = GenerateSource(grouping.Key.TargetName, grouping.Key.TargetNamespace, grouping.Key.TargetVisibility, grouping.Key.TargetType, [.. grouping]); + context.AddSource($"{grouping.Key.FileHintName}.ReactiveCollections.g.cs", source); + } + }); + } +} diff --git a/src/ReactiveUI.SourceGenerators.Roslyn/ReactiveCommand/ReactiveCommandGenerator.Execute.cs b/src/ReactiveUI.SourceGenerators.Roslyn/ReactiveCommand/ReactiveCommandGenerator.Execute.cs index bbd2d42..f67d0f3 100644 --- a/src/ReactiveUI.SourceGenerators.Roslyn/ReactiveCommand/ReactiveCommandGenerator.Execute.cs +++ b/src/ReactiveUI.SourceGenerators.Roslyn/ReactiveCommand/ReactiveCommandGenerator.Execute.cs @@ -160,9 +160,7 @@ private static string GenerateClassWithCommands(string containingTypeName, strin return $$""" -/// - /// Partial class for the {{containingTypeName}} which contains ReactiveUI ReactiveCommand initialization. - /// + {{containingClassVisibility}} partial {{containingType}} {{containingTypeName}} { {{commandDeclarations}} diff --git a/src/ReactiveUI.SourceGenerators.Roslyn/ReactiveUI.SourceGenerators.Roslyn.projitems b/src/ReactiveUI.SourceGenerators.Roslyn/ReactiveUI.SourceGenerators.Roslyn.projitems index 0b6ebe4..dad13ba 100644 --- a/src/ReactiveUI.SourceGenerators.Roslyn/ReactiveUI.SourceGenerators.Roslyn.projitems +++ b/src/ReactiveUI.SourceGenerators.Roslyn/ReactiveUI.SourceGenerators.Roslyn.projitems @@ -61,6 +61,9 @@ + + + diff --git a/version.json b/version.json index 1737bf6..720a022 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "2.3", + "version": "2.4", "publicReleaseRefSpec": [ "^refs/heads/master$", // we release out of master "^refs/heads/main$",