diff --git a/.editorconfig b/.editorconfig index 01cccffd..a8a3dad2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,6 +7,8 @@ root = true # Default settings ############################################# [*] +# Every file is UTF-8 without a byte order mark, with LF line endings, on every platform. XAML included. +charset = utf-8 end_of_line = lf insert_final_newline = true indent_style = space @@ -1429,6 +1431,7 @@ dotnet_diagnostic.SST1522.severity = error # A file has more code lines than the dotnet_diagnostic.SST1523.severity = error # A member has more code lines than the configured maximum (default 60) dotnet_diagnostic.SST1524.severity = error # A switch section has more code lines than the configured maximum (default 20) dotnet_diagnostic.SST1525.severity = error # A multi-statement `switch` section has no braces; the braces-on policy extends to switch sections. Code fix wraps it. +dotnet_diagnostic.SST1534.severity = none # Switch braces that scope nothing — conflicts with SST1525's braces-on policy dotnet_diagnostic.SST1526.severity = error # A wrapped binary expression places the operator inconsistently. Configurable (`before`/`after`, default before). Opt-in. dotnet_diagnostic.SST1527.severity = error # The `=>` of an expression-bodied member wraps inconsistently. Configurable. Opt-in. dotnet_diagnostic.SST1528.severity = error # The `=` of a wrapped initializer wraps inconsistently. Configurable. Opt-in. @@ -2827,9 +2830,6 @@ indent_size = 2 [*.sh] end_of_line = lf -[*.{cmd, bat}] -end_of_line = crlf - ############################################# # Test projects (TUnit) ############################################# diff --git a/.gitattributes b/.gitattributes index a510aa72..bedb4e88 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,13 @@ -*.cs text eol=lf +# Text files are stored and checked out with LF line endings on every platform. +# Files are UTF-8 without a byte order mark; .editorconfig sets that for editors. +* text=auto eol=lf + +# Binary files are never normalised. +*.png binary +*.jpg binary +*.ico binary +*.snk binary +*.dll binary +*.exe binary +*.nupkg binary +*.nettrace binary diff --git a/.gitignore b/.gitignore index dfcfd56f..e95da353 100644 --- a/.gitignore +++ b/.gitignore @@ -348,3 +348,10 @@ MigrationBackup/ # Ionide (cross platform F# VS Code tools) working folder .ionide/ + +# Claude Code local workspace +.claude/ + +# BenchmarkDotNet +**/.bdn/ +**/BenchmarkDotNet.Artifacts/ diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..df104b9a --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,5 @@ +# AGENTS.md + +Compatibility entrypoint only. + +Follow [CLAUDE.md](./CLAUDE.md) in this repository as the authoritative instruction file. diff --git a/CLAUDE.md b/CLAUDE.md index 1093faea..c99910c4 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,9 +4,9 @@ This document provides guidance for AI assistants and contributors working in th ## Overview -ReactiveUI.SourceGenerators is a Roslyn incremental source-generator package that automates ReactiveUI boilerplate at compile-time. It generates reactive properties, observable-as-property helpers, reactive commands, IViewFor registrations, bindable derived lists, reactive collections, and full reactive-object scaffolding — all with zero runtime reflection, making generated code fully AOT-compatible. +ReactiveUI.SourceGenerators is a Roslyn incremental source-generator package that automates ReactiveUI boilerplate at compile-time. It generates reactive properties, reactive commands, `IViewFor` implementations, WinForms view hosts, bindable derived lists, reactive collections, and full reactive-object scaffolding — all with zero runtime reflection, making generated code fully AOT-compatible. -**Minimum consumer requirements:** C# 12.0 · Visual Studio 17.8.0 · ReactiveUI 19.5.31+ +**Minimum consumer requirements:** C# 12.0 · Visual Studio 17.8.0 · ReactiveUI 23.2.28+ ## Architecture Overview @@ -14,8 +14,8 @@ The repository ships **three versioned generator assemblies** built from a singl | Project | Roslyn version | Preprocessor constant | Extra features | |---------|---------------|-----------------------|----------------| -| `ReactiveUI.SourceGenerators.Roslyn480` | 4.8.x (baseline) | _(none)_ | Field-based `[Reactive]`, `[ObservableAsProperty]`, `[ReactiveCommand]`, etc. | -| `ReactiveUI.SourceGenerators.Roslyn4120` | 4.12.0 | `ROSYLN_412` | + partial-property `[Reactive]` and `[ObservableAsProperty]` | +| `ReactiveUI.SourceGenerators.Roslyn480` | 4.8.x (baseline) | _(none)_ | Field-based `[Reactive]`, `[ReactiveCommand]`, etc. | +| `ReactiveUI.SourceGenerators.Roslyn4140` | 4.14.0 | `ROSYLN_412` | + partial-property `[Reactive]` | | `ReactiveUI.SourceGenerators.Roslyn5000` | 5.0.0 | `ROSYLN_500` | + same partial-property support on Roslyn 5 | Each versioned project links all `.cs` files from `ReactiveUI.SourceGenerators.Roslyn/` via: @@ -26,9 +26,11 @@ Each versioned project links all `.cs` files from `ReactiveUI.SourceGenerators.R `#if ROSYLN_412 || ROSYLN_500` guards inside the shared source enable partial-property pipelines only on the newer Roslyn builds. -The `ReactiveUI.SourceGenerators` NuGet project packages all three DLLs under separate `analyzers/dotnet/roslyn4.8/cs`, `analyzers/dotnet/roslyn4.12/cs`, and `analyzers/dotnet/roslyn5.0/cs` paths, so NuGet/MSBuild automatically selects the right build based on the host compiler. +The `ReactiveUI.SourceGenerators` NuGet project packages all three DLLs under separate `analyzers/dotnet/roslyn4.8/cs`, `analyzers/dotnet/roslyn4.14/cs`, and `analyzers/dotnet/roslyn5.0/cs` paths, so NuGet/MSBuild automatically selects the right build based on the host compiler. -Diagnostics are **not** reported by generators. All `RXUISG*` diagnostics live in the separate `ReactiveUI.SourceGenerators.Analyzers.CodeFixes` project. +Generators report only the `RXUISG*` diagnostics about input they cannot generate from (see +[Analyzer Separation](#analyzer-separation-roslyn-best-practice)). Diagnostics about how code should be written, and +their code fixes, live in the separate `ReactiveUI.SourceGenerators.Analyzers.CodeFixes` project. ## Project Structure @@ -38,7 +40,6 @@ src/ │ ├── AttributeDefinitions.cs # Injected attribute source texts │ ├── Reactive/ # [Reactive] generator + Execute + models │ ├── ReactiveCommand/ # [ReactiveCommand] generator + Execute + models -│ ├── ObservableAsProperty/ # [ObservableAsProperty] generator + Execute + models │ ├── IViewFor/ # [IViewFor] generator + Execute + models │ ├── RoutedControlHost/ # [RoutedControlHost] generator │ ├── ViewModelControlHost/ # [ViewModelControlHost] generator @@ -46,46 +47,63 @@ src/ │ ├── ReactiveCollection/ # [ReactiveCollection] generator │ ├── ReactiveObject/ # [IReactiveObject] generator │ ├── Diagnostics/ # DiagnosticDescriptors, SuppressionDescriptors +│ ├── Polyfills/ # netstandard2.0 polyfills, also linked into the code fixes │ └── Core/ +│ ├── CodeGeneration/ # SourceWriter, PooledBuilder, SourceWriterExtensions │ ├── Extensions/ # ISymbol*, ITypeSymbol*, INamedTypeSymbol*, AttributeData extensions │ ├── Helpers/ # ImmutableArrayBuilder, EquatableArray, HashCode, etc. │ └── Models/ # Result, DiagnosticInfo, TargetInfo, etc. ├── ReactiveUI.SourceGenerators.Roslyn480/ # Roslyn 4.8 build (no define) -├── ReactiveUI.SourceGenerators.Roslyn4120/ # Roslyn 4.12 build (ROSYLN_412) +├── ReactiveUI.SourceGenerators.Roslyn4140/ # Roslyn 4.14 build (ROSYLN_412) ├── ReactiveUI.SourceGenerators.Roslyn5000/ # Roslyn 5.0 build (ROSYLN_500) ├── ReactiveUI.SourceGenerators.Analyzers.CodeFixes/ # Analyzers + code fixers ├── ReactiveUI.SourceGenerators/ # NuGet packaging project (bundles all three DLLs) -├── ReactiveUI.SourceGenerator.Tests/ # TUnit + Verify snapshot tests +├── ReactiveUI.SourceGenerator.Tests/ # TUnit tests with generator snapshots (GeneratorSnapshot) +├── benchmarks/ # BenchmarkDotNet generation benchmarks with EventPipe tracing ├── ReactiveUI.SourceGenerators.Execute*/ # Compile-time execution verification projects └── TestApps/ # Manual test applications (WPF, WinForms, MAUI, Avalonia) ``` ## Code Generation Strategy -All generated C# source is produced using **raw string literals** (`$$"""..."""`). Do **not** use `StringBuilder` or `SyntaxFactory` for code generation. +Generated source is written through `SourceWriter` (`Core/CodeGeneration`), an indentation-aware writer adopted from +the ReactiveUI.Binding generators. The writer indents each line from its level when the line's first character is +written, so an emitter says what it builds - a namespace, a containing type, a block - and the layout follows. It +rents its `StringBuilder` from a per-thread free list (`PooledBuilder`), so a generation pass reuses buffers. ```csharp -// CORRECT — raw string literal with $$ interpolation -internal static string GenerateProperty(string name, string type) => $$""" - public {{type}} {{name}} +// CORRECT - append pieces straight into the writer; braces move the level +var writer = SourceWriter.Rent().AutoGenerated().DisableWarningsEnableNullable().BlankLine(); +var depth = writer.OpenNamespace(target.TargetNamespace) + writer.OpenContainingTypes(target.ParentInfo); +_ = writer.OpenPartialType(target) + .Append("public ").Append(property.Type).Append(' ').Line(property.Name) + .OpenBlock() + .Append("get => ").Append(property.FieldName).EndStatement() + .CloseBlock(); +return writer.CloseBlock().CloseBlocks(depth).RestoreNullableAndWarnings().ToStringAndReturn(); + +// Fixed multi-line text: Lines() with a raw literal, no interpolation, indented relative to the current level +_ = writer.Lines(""" + protected override void Dispose(bool disposing) { - get => _{{char.ToLower(name[0])}{{name.Substring(1)}}}; - set => this.RaiseAndSetIfChanged(ref _{{char.ToLower(name[0])}{{name.Substring(1)}}}, value); + base.Dispose(disposing); } - """; + """); -// WRONG — do not use StringBuilder -var sb = new StringBuilder(); -sb.AppendLine($"public {type} {name}"); -// ... - -// WRONG — do not use SyntaxFactory -SyntaxFactory.PropertyDeclaration(...) +// WRONG - $"" / $$"""...""" interpolation, string.Join, StringBuilder or SyntaxFactory in an emitter: +// each builds intermediate strings per member, and spelled-out indentation breaks in nested types. ``` -Raw string literals preserve formatting intent, are trivially diffable in code review, and do not require the overhead of SyntaxFactory node construction. +`SourceWriterExtensions` names the constructs the generators share: `AutoGenerated`, `Using`, +`DisableWarningsEnableNullable`/`RestoreNullableAndWarnings`, `OpenNamespace` (block-scoped; the global namespace opens +nothing), `OpenContainingTypes`, `OpenPartialType`, `CloseBlocks`, `InheritDoc`, `ExcludeFromCodeCoverage`. Build a +generator's `GeneratedCode` attribute once, in a static field, with `SourceWriterExtensions.GeneratedCodeAttribute`. + +The injected attribute source texts (in `AttributeDefinitions.cs`) are fixed `$$"""..."""` raw strings, each built once +per process. -The injected attribute source texts (in `AttributeDefinitions.cs`) also use `$$"""..."""` raw string literals. +A change to an emitter must keep the output token-for-token the same unless it deliberately changes generated code; +compare changed snapshots with whitespace removed to prove it. ## Roslyn Incremental Pipeline Pattern @@ -94,7 +112,7 @@ Each generator follows this structure: 1. **`Initialize`** — registers post-initialization output (inject attribute source), then calls one or more `Run*` methods. 2. **`Run*`** — builds the `IncrementalValuesProvider` using `ForAttributeWithMetadataName` + a syntax predicate + a semantic extraction function. 3. **`Get*Info` (Execute file)** — stateless extraction function. Returns `Result` with embedded diagnostics. Must be pure; must not capture any `ISymbol` or `SyntaxNode` beyond this call. -4. **`GenerateSource` (Execute file)** — pure function that converts model → raw string source text. No Roslyn symbols allowed here. +4. **`GenerateSource` (Execute file)** — pure function that writes a model through `SourceWriter`. No Roslyn symbols allowed here. ``` Initialize() @@ -105,6 +123,15 @@ Initialize() └─ RegisterSourceOutput → GenerateSource() → AddSource() ``` +**Fast paths:** +- Find attributed targets with `ForAttributeWithMetadataName`; benchmarks show it allocates less than a syntax + provider, cold and incrementally. A generic attribute is registered by its arity name (``IViewForAttribute`1``). +- Reject nodes in the syntax predicate before any binding: node kind, parent shape, `partial` modifier. +- In the transform, read `context.Attributes[0]` rather than searching the symbol's attributes again, and ask for + semantic information only when syntax says it can exist (documentation only when the node has a doc comment). +- Group models per type with `GroupByTarget` and register one source output per type, so an edit rewrites only the + types whose models changed. Tag steps with `TrackingNames`; `IncrementalCachingTests` asserts what is reused. + **Incremental caching rules:** - All pipeline output models must implement value equality (`record`, `IEquatable`, or `EquatableArray`). - Never store `ISymbol`, `SyntaxNode`, `SemanticModel`, or `CancellationToken` in a model. @@ -116,14 +143,16 @@ Initialize() |-----------------|-----------|--------------| | `ReactiveGenerator` | `[Reactive]` | Field (all Roslyn) or partial property (ROSYLN_412+) | | `ReactiveCommandGenerator` | `[ReactiveCommand]` | Method | -| `ObservableAsPropertyGenerator` | `[ObservableAsProperty]` | Field or observable method | -| `IViewForGenerator` | `[IViewFor]` | Class | +| `IViewForGenerator` | `[IViewFor]` | Class (the `IViewFor` implementation; view registration belongs to ReactiveUI.Binding) | | `RoutedControlHostGenerator` | `[RoutedControlHost]` | Class | | `ViewModelControlHostGenerator` | `[ViewModelControlHost]` | Class | | `BindableDerivedListGenerator` | `[BindableDerivedList]` | Field (`ReadOnlyObservableCollection`) | | `ReactiveCollectionGenerator` | `[ReactiveCollection]` | Field (`ObservableCollection`) | | `ReactiveObjectGenerator` | `[IReactiveObject]` | Class | +`[ObservableAsProperty]` and IViewFor view registration moved to ReactiveUI.Binding (ReactiveUI's binding engine) and +were removed here. Do not reintroduce features ReactiveUI.Binding provides. + ## Analyzers & Suppressors All diagnostics use the `RXUISG` prefix. All suppressions use the `RXUISPR` prefix. @@ -139,8 +168,13 @@ Suppressors silence noisy Roslyn/Roslynator diagnostics that are expected for ge ### Analyzer Separation (Roslyn Best Practice) -- Generators do **not** report diagnostics — they only call `context.ReportDiagnostic` for internal invariant violations via `DiagnosticInfo` models. -- The `ReactiveUI.SourceGenerators.Analyzers.CodeFixes` project owns all `RXUISG*` diagnostic descriptors and code fixers. +- Generators report a diagnostic only when their input cannot be generated from: a name collision (RXUISG0009), an + invalid forwarded attribute (RXUISG0012, RXUISG0013), a containing type that is not a `ReactiveObject` + (RXUISG0018), or a `[BindableDerivedList]` field of the wrong type (RXUISG0019). The extraction step returns them as + `DiagnosticInfo` values inside `Result`, and `RegisterDiagnostics` (`Core/Extensions/IncrementalPipelineExtensions.cs`) + reports them from a source output, so they never break caching. Do not add new diagnostics to generators. +- The `ReactiveUI.SourceGenerators.Analyzers.CodeFixes` project owns every other `RXUISG*` diagnostic (such as + RXUISG0016 and RXUISG0020) and all code fixers. - `DiagnosticDescriptors.cs` and related files are compiled from the shared Roslyn source via the linked `` items. ## Testing @@ -148,7 +182,7 @@ Suppressors silence noisy Roslyn/Roslynator diagnostics that are expected for ge ### Framework - **TUnit** — test runner and assertion library (replaces xUnit/NUnit). -- **Verify.SourceGenerators** — snapshot-based verification of generated source output. +- **`GeneratorSnapshot`** (in the test project) — compares each generated file with a stored snapshot. No Verify packages. - **Microsoft.Testing.Platform** — native test execution (configured via `testconfig.json`). ### Test project targets @@ -157,14 +191,23 @@ The test project multi-targets `net8.0;net9.0;net10.0` (controlled by `$(TestTfm ### Snapshot tests -Generator tests extend `TestBase` and call `TestHelper.TestPass(sourceCode)`. Verify saves `.verified.txt` snapshots in the appropriate subdirectory (`REACTIVE/`, `REACTIVECMD/`, `OAPH/`, `IVIEWFOR/`, `DERIVEDLIST/`, `REACTIVECOLL/`, `REACTIVEOBJ/`). +Generator tests extend `TestBase` and call `TestHelper.TestPass(sourceCode)`. Each generated file is stored +as `{FOLDER}/{class}.{method}#{hint}.verified.cs` in the generator's folder (`REACTIVE/`, `REACTIVECMD/`, `IVIEWFOR/`, +`DERIVEDLIST/`, `REACTIVECOLL/`, `REACTIVEOBJ/`). The class segment is the test class's capitals, and common words in the +method and hint segments are abbreviated, so every path stays well inside the Windows path limit. A mismatch writes +`*.received.cs` beside the snapshot and fails; a snapshot the run no longer produces also fails. Generated-code +attribute lines, which carry the assembly version, are left out of the snapshots. #### Accepting snapshot changes -1. Enable `VerifierSettings.AutoVerify()` in `ModuleInitializer.cs`. -2. Run `dotnet test --project src/ReactiveUI.SourceGenerator.Tests -c Release`. -3. Disable `VerifierSettings.AutoVerify()`. -4. Re-run tests to confirm all pass without AutoVerify. +1. From `src`, set `ACCEPT_SNAPSHOTS` to `1` (or `true`) and run the tests: + ```pwsh + $env:ACCEPT_SNAPSHOTS = '1' + dotnet test --project ReactiveUI.SourceGenerator.Tests/ReactiveUI.SourceGenerators.Tests.csproj -c Release -f net10.0 + Remove-Item Env:ACCEPT_SNAPSHOTS + ``` +2. Review the snapshot diff; for a refactor, confirm the changes are whitespace only. +3. Re-run the tests without `ACCEPT_SNAPSHOTS` to confirm all pass. ### Test source language version @@ -179,11 +222,12 @@ Analyzer and helper tests use direct `CSharpCompilation` / `CompilationWithAnaly ### Adding a New Generator 1. Create a value-equatable model record in `Core/Models/` or the generator's own `Models/` folder. -2. Add attribute source text to `AttributeDefinitions.cs` using a `$$"""..."""` raw string literal. +2. Add attribute source text to `AttributeDefinitions.cs` as a `$$"""..."""` raw string property initialised once. 3. Create `Generator.cs` with `Initialize` wiring up `ForAttributeWithMetadataName`. -4. Create `Generator.Execute.cs` with `Get*Info` (extraction) and `GenerateSource` (raw string template). +4. Create `Generator.Execute.cs` with `Get*Info` (extraction) and `GenerateSource` (writes through `SourceWriter`). 5. Add snapshot tests in `ReactiveUI.SourceGenerator.Tests/UnitTests/`. -6. Accept snapshots using the AutoVerify trick above. +6. Accept snapshots with `ACCEPT_SNAPSHOTS=1` as above. +7. Add a mock to `src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks` and the generator to `GeneratorCatalog`. ### Adding a New Analyzer Diagnostic @@ -194,27 +238,49 @@ Analyzer and helper tests use direct `CSharpCompilation` / `CompilationWithAnaly ### Running Tests +Run from `src`, where `global.json` selects the SDK and Microsoft.Testing.Platform: + ```pwsh -dotnet test src/ReactiveUI.SourceGenerator.Tests --configuration Release +cd src +dotnet test --project ReactiveUI.SourceGenerator.Tests/ReactiveUI.SourceGenerators.Tests.csproj -c Release ``` +### Measuring allocations + +```pwsh +cd src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks +dotnet run -c Release -- --smoke # every corpus generates and compiles +dotnet run -c Release -- --eventpipe # bytes per run from GCAllocationTick, one trace per scenario +dotnet run -c Release -- --eventpipe-discovery # attribute discovery strategies against each other +cd ../ReactiveUI.SourceGenerators.Runtime.Benchmarks +dotnet run -c Release -- --eventpipe # the generated code, as an app runs it +``` + +Each scenario writes `/.nettrace`; open it in PerfView's "GC Heap Alloc Ignore Free (Coarse Sampling) +Stacks" view to see which frames allocate. + +Report allocation figures from the EventPipe traces, not the memory diagnoser, and compare a change against the +previous commit with the same harness. `src/benchmarks/README.md` has the method and the current figures. + ### Building ```pwsh -dotnet build src/ReactiveUI.SourceGenerators.sln +dotnet build src/ReactiveUI.SourceGenerators.slnx ``` ## What to Avoid - **`ISymbol` / `SyntaxNode` in pipeline output models** — breaks incremental caching; use value-equatable data records instead. -- **`SyntaxFactory` for code generation** — use `$$"""..."""` raw string literals. -- **`StringBuilder` for code generation** — use `$$"""..."""` raw string literals. -- **Diagnostics reported inside generators** — use the separate analyzer project for all `RXUISG*` diagnostics. +- **`SyntaxFactory` for code generation** — write through `SourceWriter`. +- **`StringBuilder`, `string.Join` or interpolation in emitters** — append into `SourceWriter`. +- **New diagnostics reported inside generators** — put new `RXUISG*` diagnostics in the separate analyzer project. - **LINQ in hot Roslyn pipeline paths** — use `foreach` loops (Roslyn convention for incremental generators). - **Non-value-equatable models** in the incremental pipeline — will defeat caching and cause unnecessary regeneration. - **APIs unavailable in `netstandard2.0`** inside `ReactiveUI.SourceGenerators.Roslyn*` projects — the generator must run inside the compiler host which targets netstandard2.0. - **Runtime reflection** in generated code — breaks Native AOT compatibility. -- **`#nullable enable` / nullable annotations in generated output** — these require C# 8+ features; generated code must be compatible with the minimum consumer C# version (12.0). +- **Language features newer than C# 12 in generated output** — generated code must compile at the minimum consumer + C# version (12.0). `#nullable enable` and nullable annotations are fine; generated files open with + `DisableWarningsEnableNullable()`. - **File-scoped namespaces in generated output** — requires C# 10; use block-scoped namespaces. ## Important Notes @@ -222,7 +288,7 @@ dotnet build src/ReactiveUI.SourceGenerators.sln - **Required .NET SDKs:** .NET 8.0, 9.0, and 10.0 (all required for multi-targeting the test project). - **Generator + Analyzer targets:** `netstandard2.0` (Roslyn host requirement). - **Test project targets:** `net8.0;net9.0;net10.0`. -- **No shallow clones:** The repository uses Nerdbank.GitVersioning; a full `git clone` is required for correct versioning. +- **No shallow clones:** The repository uses MinVer; a full `git clone` with tags is required for correct versioning. - **NuGet packaging:** The `ReactiveUI.SourceGenerators` project bundles all three versioned generator DLLs at different `analyzers/dotnet/roslyn*/cs` paths. - **Cross-platform tests:** On non-Windows platforms, WPF/WinForms types are injected as source stubs so generator tests compile cross-platform. - **`SyntaxFactory` helper:** https://roslynquoter.azurewebsites.net/ — useful for inspecting how Roslyn models a given syntax construct (reference only; do not use SyntaxFactory in code-gen paths). diff --git a/README.md b/README.md index d16c074a..df1ab672 100644 --- a/README.md +++ b/README.md @@ -13,11 +13,11 @@ This documentation covers using ReactiveUI Source Generators to simplify and enh - [Supported Attributes & Features](#supported-attributes) - [Detailed Usage](#welcome-to-a-new-way---source-generators) - [Reactive](#reactive) - - [ObservableAsProperty](#observableasproperty) - [ReactiveCommand](#reactivecommand) - [IViewFor](#iviewfor) - [BindableDerivedList](#usage-readonlyobservablecollection) - [Platform-Specific Attributes](#platform-specific-attributes) +- [Moved to ReactiveUI.Binding](#moved-to-reactiveuibinding) - [Compatibility Notes](#compatibility-notes) - [Credits](#credits) @@ -40,10 +40,6 @@ ReactiveUI Source Generators automatically generate ReactiveUI objects to stream - `[Reactive(Inheritance = InheritanceModifier.Virtual)]` With field and access modifiers. This will generate a virtual property. - `[Reactive(UseRequired = true)]` With field and access modifiers. This will generate a required property, (Not Required for partial properties, use required keyword for property declaration). - `[Reactive(nameof(RaiseProperty1), nameof(RaiseProperty2))]` With field and property changed notification for additional properties. -- `[ObservableAsProperty]` With field, method, Observable property and partial property support (C# 13 Visual Studio Version 17.12.0) -- `[ObservableAsProperty(ReadOnly = false)]` Removes readonly keyword from the generated helper field -- `[ObservableAsProperty(PropertyName = "ReadOnlyPropertyName")]` -- `[ObservableAsProperty(InitialValue = "Default Value")]` Only valid for partial properties using (C# 13 Visual Studio Version 17.12.0) - `[ReactiveCommand]` - `[ReactiveCommand(RunInBackground = true)]` runs a synchronous command on ReactiveUI's background scheduler - `[ReactiveCommand(CanExecute = nameof(IObservableBoolName))]` with CanExecute @@ -54,24 +50,13 @@ ReactiveUI Source Generators automatically generate ReactiveUI objects to stream - `[IViewFor(nameof(ViewModelName))]` - `[IViewFor]` - `[IViewFor("YourNameSpace.YourGenericViewModel")]` Generic -- `[IViewFor(RegistrationType = SplatRegistrationType.PerRequest)]` with Splat Registration Type for IViewFor registration. -- `[IViewFor(RegistrationType = SplatRegistrationType.LazySingleton)]` Generic with Splat Registration Type for IViewFor registration. -- `[IViewFor(RegistrationType = SplatRegistrationType.Constant)]` Generic with Splat Registration Type for IViewFor registration. -- `[IViewFor(ViewModelRegistrationType = SplatRegistrationType.PerRequest)]` Generic with Splat Registration Type for ViewModel registration. -- `[IViewFor(ViewModelRegistrationType = SplatRegistrationType.LazySingleton)]` Generic with Splat Registration Type for ViewModel registration. -- `[IViewFor(ViewModelRegistrationType = SplatRegistrationType.Constant)]` Generic with Splat Registration Type for ViewModel registration. - `[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 - `[IReactiveObject]` Generates IReactiveObject implementation for classes not able to inherit from ReactiveObject -#### IViewFor Registration generator - -To register all views for view models registered via the IViewFor Source Generator with a specified `RegistrationType`, call the following method during application startup: -```csharp -Splat.Locator.CurrentMutable.RegisterViewsForViewModelsSourceGenerated(); -``` +`[ObservableAsProperty]` and IViewFor view registration moved to ReactiveUI.Binding; see [Moved to ReactiveUI.Binding](#moved-to-reactiveuibinding). ### Compatibility Notes - For **.NET Framework 4.8 and older**, add [Polyfill by Simon Cropp](https://github.com/SimonCropp/Polyfill) or [PolySharp by Sergio Pedri](https://github.com/Sergio0694/PolySharp) to your project and set the `LangVersion` to 12.0 or later in your project file. @@ -105,14 +90,11 @@ For more information on analyzer codes, see the [analyzer codes documentation](h ### `[Reactive]` Marks properties as reactive, generating getter and setter code. -### `[ObservableAsProperty]` -Generates read-only properties backed by an `ObservableAsPropertyHelper` based on an `IObservable`. - ### `[ReactiveCommand]` Generates commands, with options to add attributes or enable `CanExecute` functionality. ### `[IViewFor]` -Links a view to a view model for data binding. Supports generic types and Splat registration. +Links a view to a view model for data binding. Supports generic types. ### `[RoutedControlHost]` and `[ViewModelControlHost]` Platform-specific attributes for control hosting in WinForms applications. @@ -148,31 +130,6 @@ With ReactiveUI.Fody the `[Reactive]` Attribute was placed on a Public Property public string Name { get; set; } ``` -## ObservableAsPropertyHelper properties -Similarly, to declare output properties, the code looks like this: -```csharp -public partial class MyReactiveClass : ReactiveObject -{ - ObservableAsPropertyHelper _firstName; - - public MyReactiveClass() - { - _firstName = firstNameObservable - .ToProperty(this, x => x.FirstName); - } - - public string FirstName => _firstName.Value; - - private IObservable firstNameObservable() => Observable.Return("Test"); -} -``` - -With ReactiveUI.Fody, you can simply declare a read-only property using the [ObservableAsProperty] attribute, using either option of the two options shown below. -```csharp -[ObservableAsProperty] -public string FirstName { get; } -``` - ## Migration from ReactiveUI.Fody To migrate from ReactiveUI.Fody to ReactiveUI.SourceGenerators, follow these steps: 1. **Remove ReactiveUI.Fody**: Uninstall the ReactiveUI.Fody NuGet package from your project. @@ -181,8 +138,9 @@ Remove the Fody support files from the project directory - FodyWeaver.xml - FodyWeavers.xsd 2. **Install ReactiveUI.SourceGenerators**: Add the ReactiveUI.SourceGenerators NuGet package -3. **Update Property Declarations**: Place `[Reactive]` and `[ObservableAsProperty]` attributes on your properties as shown in the examples below and ensure that your classes and properties are declared as `partial`. You can also use field backing for `[Reactive]` properties as shown in the examples. This is a change from ReactiveUI.Fody which only supported property backing. +3. **Update Property Declarations**: Place `[Reactive]` attributes on your properties as shown in the examples below and ensure that your classes and properties are declared as `partial`. You can also use field backing for `[Reactive]` properties as shown in the examples. This is a change from ReactiveUI.Fody which only supported property backing. Remove using directives for `ReactiveUI.Fody.Helpers` and add using directives for `ReactiveUI.SourceGenerators`. +Fody's `[ObservableAsProperty]` has no equivalent in this package; see [A read-only property backed by an observable](#a-read-only-property-backed-by-an-observable). 4. **Rebuild Your Project**: Ensure that your project builds successfully and that the generated code behaves as expected. # Welcome to a new way - Source Generators @@ -267,177 +225,82 @@ Define types with `[Reactive]` properties in assembly `A`, and then define the `System.Text.Json.JsonSerializerContext` source generation context in assembly `B`, and let `B` reference `A`. -## Usage ObservableAsPropertyHelper `[ObservableAsProperty]` - -ObservableAsPropertyHelper is used to create a read-only property from an IObservable. The generated code will create a backing field and a property that returns the value of the backing field. The backing field is initialized with the value of the IObservable when the class is instantiated. +## Moved to ReactiveUI.Binding -A private field is created with the name of the property prefixed with an underscore. The field is initialized with the value of the IObservable when the class is instantiated. The property is created with the same name as the field without the underscore. The property returns the value of the field until initialized, then it returns the value of the IObservable. +ReactiveUI's binding engine, [ReactiveUI.Binding](https://github.com/reactiveui/ReactiveUI.Binding.SourceGenerators), +now provides two features this package used to generate. They have been removed from ReactiveUI.SourceGenerators. -You can define the name of the property by using the PropertyName parameter. If you do not define the PropertyName, the property name will be the same as the field name without the underscore. +| Removed | Use instead | +| --- | --- | +| `[ObservableAsProperty]` on a field, method, observable property or partial property, and the generated `InitializeOAPH()` | ReactiveUI.Binding's `[ObservableAsProperty]` on a `partial` property, assigned with `ToProperty` | +| `RegisterViewsForViewModelsSourceGenerated()`, the `RegistrationType` and `ViewModelRegistrationType` options of `[IViewFor]`, and `SplatRegistrationType` | ReactiveUI.Binding's view locator, which registers views at compile time | +| RXUISG0014, RXUISG0017 and the RXUISPR0002 suppression | Nothing: they only applied to `[ObservableAsProperty]` | -### Usage ObservableAsPropertyHelper with Field -```csharp -using ReactiveUI.SourceGenerators; +`[IViewFor]` still generates the `ViewModel` property and the `IViewFor` implementation for each UI platform. It +implements the `IViewFor` of the ReactiveUI the project references: ReactiveUI's own on releases not built on +ReactiveUI.Binding, otherwise `ReactiveUI.Binding.IViewFor`, or `ReactiveUI.Binding.Reactive.IViewFor` with +ReactiveUI.Reactive. The interface is named in full, so no `using` for ReactiveUI.Binding is needed. The Windows Forms +`[RoutedControlHost]` and `[ViewModelControlHost]` resolve views through the matching view locator. -public partial class MyReactiveClass : ReactiveObject -{ - [ObservableAsProperty] - private string _myProperty = "Default Value"; +The ReactiveUI.Binding replacements need a ReactiveUI release built on ReactiveUI.Binding. ReactiveUI 24.3 and earlier +are not: there, ReactiveUI's own `ObservableAsPropertyHelper` and `IViewFor` are the ones in use, so +ReactiveUI.Binding's `ToProperty` does not produce the helper its generated property expects, and its view locator does +not see ReactiveUI's `IViewFor`. On those releases, use the hand-written forms below. - public MyReactiveClass() - { - _myPrpertyHelper = MyPropertyObservable() - .ToProperty(this, x => x.MyProperty); - } +### A read-only property backed by an observable - IObservable MyPropertyObservable() => Observable.Return("Test Value"); -} -``` +With ReactiveUI.Binding, mark a `partial` property `[ObservableAsProperty]` (C# 13 or later). The generator writes the +property's body and a helper field named after it, which you assign with `ToProperty`: -### Usage ObservableAsPropertyHelper with Field and non readonly nullable OAPH field ```csharp -using ReactiveUI.SourceGenerators; +using ReactiveUI; +using ReactiveUI.Binding; -public partial class MyReactiveClass : ReactiveObject, IActivatableViewModel +public partial class MyReactiveClass : ReactiveObject { - [ObservableAsProperty(ReadOnly = false)] - private string _myProperty = "Default Value"; - - public MyReactiveClass() - { - this.WhenActivated(disposables => - { - _myPrpertyHelper = MyPropertyObservable() - .ToProperty(this, x => x.MyProperty) - .DisposeWith(disposables); - }); - } + public MyReactiveClass(IObservable myPropertySource) => + _myPropertyHelper = myPropertySource.ToProperty(this, x => x.MyProperty, initialValue: "Default Value"); - IObservable MyPropertyObservable() => Observable.Return("Test Value"); + [ObservableAsProperty] + public partial string MyProperty { get; } } ``` -### Usage ObservableAsPropertyHelper with Observable Property and specific PropertyName -```csharp -using ReactiveUI.SourceGenerators; - -public partial class MyReactiveClass : ReactiveObject -{ - [ObservableAsProperty(ReadOnly = false)] - private string _myProperty = "Default Value"; - - public MyReactiveClass() - { - this.WhenActivated(disposables => - { - _myPrpertyHelper = MyPropertyObservable() - .ToProperty(this, x => x.MyProperty) - .DisposeWith(disposables); - }); - } - - IObservable MyPropertyObservable() => Observable.Return("Test Value"); -} -``` +Without ReactiveUI.Binding, or on ReactiveUI 24.3 and earlier, write the helper with ReactiveUI's `ToProperty`: -### Usage ObservableAsPropertyHelper with Observable Property and protected OAPH field ```csharp -using ReactiveUI.SourceGenerators; +using ReactiveUI; -public partial class MyReactiveClass : ReactiveObject +public class MyReactiveClass : ReactiveObject { - [ObservableAsProperty(UseProtected = true)] - private string _myProperty = "Default Value"; + private readonly ObservableAsPropertyHelper _myPropertyHelper; - public MyReactiveClass() - { - _myPrpertyHelper = MyPropertyObservable() - .ToProperty(this, x => x.MyProperty); - } + public MyReactiveClass(IObservable myPropertySource) => + _myPropertyHelper = myPropertySource.ToProperty(this, x => x.MyProperty, initialValue: "Default Value"); - IObservable MyPropertyObservable() => Observable.Return("Test Value"); + public string MyProperty => _myPropertyHelper.Value; } ``` -### Usage ObservableAsPropertyHelper with Observable Method +### Registering views -NOTE: This does not currently support methods with parameters -```csharp -using ReactiveUI.SourceGenerators; - -public partial class MyReactiveClass : ReactiveObject -{ - public MyReactiveClass() - { - // Initialize generated _myObservablePropertyHelper - // for the generated MyObservableProperty - InitializeOAPH(); - } - - [ObservableAsProperty] - IObservable MyObservable() => Observable.Return("Test Value"); -} -``` +ReactiveUI.Binding's view locator registers every class whose declaration implements `IViewFor`. Source generators +cannot see each other's output, so the view locator does not see the interface `[IViewFor]` adds. List the interface +on the class as well; the generated members still implement it: -### Usage ObservableAsPropertyHelper with Observable Method and specific PropertyName ```csharp -using ReactiveUI.SourceGenerators; - -public partial class MyReactiveClass : ReactiveObject -{ - public MyReactiveClass() - { - // Initialize generated _testValuePropertyHelper - // for the generated TestValueProperty - InitializeOAPH(); - } - - [ObservableAsProperty(PropertyName = TestValueProperty)] - IObservable MyObservable() => Observable.Return("Test Value"); +[IViewFor] +public partial class LoginView : UserControl, IViewFor +{ } ``` -### Usage ObservableAsPropertyHelper with Observable Method and protected OAPH field -```csharp -using ReactiveUI.SourceGenerators; - -public partial class MyReactiveClass : ReactiveObject -{ - public MyReactiveClass() - { - // Initialize generated _myObservablePropertyHelper - // for the generated MyObservableProperty - InitializeOAPH(); - } - - [ObservableAsProperty(UseProtected = true)] - IObservable MyObservable() => Observable.Return("Test Value"); -} -``` +Without ReactiveUI.Binding, or on ReactiveUI 24.3 and earlier, register each view with Splat: -### Usage ObservableAsPropertyHelper with partial Property and a default value ```csharp -using ReactiveUI.SourceGenerators; - -public partial class MyReactiveClass : ReactiveObject -{ - public MyReactiveClass() - { - // The value of MyProperty will be "Default Value" until the Observable is initialized - _myPrpertyHelper = MyPropertyObservable() - .ToProperty(this, nameof(MyProperty)); - } - - [ObservableAsProperty(InitialValue = "Default Value")] - public partial string MyProperty { get; } - - public IObservable MyPropertyObservable() => Observable.Return("Test Value"); -} +AppLocator.CurrentMutable.Register>(static () => new LoginView()); ``` -String values are automatically quoted, so `InitialValue = ""` produces an empty string initial value. -Non nullable `string` properties are initialized with `string.Empty` when no `InitialValue` is provided. - ## Usage ReactiveCommand `[ReactiveCommand]` ### Usage ReactiveCommand without parameter @@ -638,35 +501,6 @@ The class must inherit from a UI Control from any of the following platforms and - Avalonia (Avalonia) - Uno (Windows.UI.Xaml). -### IViewFor with Splat Registration Type - -Choose from the following Splat Registration Types, option for IViewFor Registration and / or ViewModel Registration: -- `SplatRegistrationType.PerRequest` -- `SplatRegistrationType.LazySingleton` -- `SplatRegistrationType.Constant` -- `SplatRegistrationType.None` (Default if not specified - no registration is performed) - -```csharp -using ReactiveUI.SourceGenerators; -using Splat; -[IViewFor(RegistrationType = SplatRegistrationType.PerRequest, ViewModelRegistrationType = SplatRegistrationType.LazySingleton)] -public partial class MyReactiveControl : UserControl -{ - public MyReactiveControl() - { - InitializeComponent(); - ViewModel = AppLocator.Current.GetService(); - } -} -``` - -this will generate the following code to enable you register the marked Views as `IViewFor` with Splat: -```csharp -using ReactiveUI.SourceGenerators; - -Splat.AppLocator.CurrentMutable.RegisterViewsForViewModelsSourceGenerated(); -``` - ### Usage IViewFor with ViewModel Name - Generic Types should be used with the fully qualified name, otherwise use nameof(ViewModelTypeName) ```csharp using ReactiveUI.SourceGenerators; @@ -762,9 +596,6 @@ public partial class MyReactiveClass } ``` -### TODO: -- Add ObservableAsProperty to generate from a IObservable method with parameters. - # Credits Portions of this code base are based on and derived from diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index b548c23c..7226d700 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -3,42 +3,41 @@ true true 4.14.0 - 3.40.2 + 5.1.2 - - - + + + - + - - - - + + + - + - - - + + + - - - + + + diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/BindableDerivedListGeneratorTests.FromReactiveProperties#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/BDLG.FRxProps#BdlAttr.verified.cs similarity index 92% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/BindableDerivedListGeneratorTests.FromReactiveProperties#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/BDLG.FRxProps#BdlAttr.verified.cs index f529f0cc..1150c13e 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/BindableDerivedListGeneratorTests.FromReactiveProperties#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/BDLG.FRxProps#BdlAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs // Copyright (c) 2026 .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. diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/BindableDerivedListGeneratorTests.FromReactiveProperties#TestNs.TestVM.BindableDerivedList.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/BDLG.FRxProps#TestNs.TestVM.Bdl.verified.cs similarity index 84% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/BindableDerivedListGeneratorTests.FromReactiveProperties#TestNs.TestVM.BindableDerivedList.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/BDLG.FRxProps#TestNs.TestVM.Bdl.verified.cs index a59391be..6cb69fee 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/BindableDerivedListGeneratorTests.FromReactiveProperties#TestNs.TestVM.BindableDerivedList.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/BDLG.FRxProps#TestNs.TestVM.Bdl.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.BindableDerivedList.g.cs +//HintName: TestNs.TestVM.BindableDerivedList.g.cs // using System.Collections.ObjectModel; using DynamicData; @@ -9,7 +9,6 @@ namespace TestNs { - public partial class TestVM { /// @@ -18,4 +17,4 @@ public partial class TestVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.DiffNamespaces#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.AccMods#BdlAttr.verified.cs similarity index 92% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.DiffNamespaces#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.AccMods#BdlAttr.verified.cs index 07ca7a20..2b2de01f 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.DiffNamespaces#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.AccMods#BdlAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs // Copyright (c) 2026 .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. diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.AccessModifiers#TestNs.TestVM.BindableDerivedList.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.AccMods#TestNs.TestVM.Bdl.verified.cs similarity index 96% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.AccessModifiers#TestNs.TestVM.BindableDerivedList.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.AccMods#TestNs.TestVM.Bdl.verified.cs index 51b6f37c..68169715 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.AccessModifiers#TestNs.TestVM.BindableDerivedList.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.AccMods#TestNs.TestVM.Bdl.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.BindableDerivedList.g.cs +//HintName: TestNs.TestVM.BindableDerivedList.g.cs // using System.Collections.ObjectModel; using DynamicData; @@ -9,7 +9,6 @@ namespace TestNs { - public partial class TestVM { /// diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.DateTimeType#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.CplxGen#BdlAttr.verified.cs similarity index 92% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.DateTimeType#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.CplxGen#BdlAttr.verified.cs index f529f0cc..1150c13e 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.DateTimeType#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.CplxGen#BdlAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs // Copyright (c) 2026 .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. diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.ComplexGeneric#TestNs.TestVM.BindableDerivedList.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.CplxGen#TestNs.TestVM.Bdl.verified.cs similarity index 84% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.ComplexGeneric#TestNs.TestVM.BindableDerivedList.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.CplxGen#TestNs.TestVM.Bdl.verified.cs index ca5f4775..d10086c0 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.ComplexGeneric#TestNs.TestVM.BindableDerivedList.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.CplxGen#TestNs.TestVM.Bdl.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.BindableDerivedList.g.cs +//HintName: TestNs.TestVM.BindableDerivedList.g.cs // using System.Collections.ObjectModel; using DynamicData; @@ -9,7 +9,6 @@ namespace TestNs { - public partial class TestVM { /// @@ -18,4 +17,4 @@ public partial class TestVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.EnumType#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.DateTimeT#BdlAttr.verified.cs similarity index 92% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.EnumType#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.DateTimeT#BdlAttr.verified.cs index f529f0cc..1150c13e 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.EnumType#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.DateTimeT#BdlAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs // Copyright (c) 2026 .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. diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.DateTimeType#TestNs.TestVM.BindableDerivedList.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.DateTimeT#TestNs.TestVM.Bdl.verified.cs similarity index 89% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.DateTimeType#TestNs.TestVM.BindableDerivedList.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.DateTimeT#TestNs.TestVM.Bdl.verified.cs index 2ed8ef7f..8979887c 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.DateTimeType#TestNs.TestVM.BindableDerivedList.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.DateTimeT#TestNs.TestVM.Bdl.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.BindableDerivedList.g.cs +//HintName: TestNs.TestVM.BindableDerivedList.g.cs // using System.Collections.ObjectModel; using DynamicData; @@ -9,7 +9,6 @@ namespace TestNs { - public partial class TestVM { /// @@ -21,4 +20,4 @@ public partial class TestVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.GenericClass#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.DiffNss#BdlAttr.verified.cs similarity index 92% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.GenericClass#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.DiffNss#BdlAttr.verified.cs index 07ca7a20..2b2de01f 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.GenericClass#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.DiffNss#BdlAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs // Copyright (c) 2026 .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. diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.DiffNamespaces#Namespace1.TestVM.BindableDerivedList.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.DiffNss#Ns1.TestVM.Bdl.verified.cs similarity index 84% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.DiffNamespaces#Namespace1.TestVM.BindableDerivedList.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.DiffNss#Ns1.TestVM.Bdl.verified.cs index 15396e56..3e42a391 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.DiffNamespaces#Namespace1.TestVM.BindableDerivedList.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.DiffNss#Ns1.TestVM.Bdl.verified.cs @@ -1,4 +1,4 @@ -//HintName: Namespace1.TestVM.BindableDerivedList.g.cs +//HintName: Namespace1.TestVM.BindableDerivedList.g.cs // using System.Collections.ObjectModel; using DynamicData; @@ -9,7 +9,6 @@ namespace Namespace1 { - public partial class TestVM { /// @@ -18,4 +17,4 @@ public partial class TestVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.DiffNamespaces#Namespace2.TestVM.BindableDerivedList.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.DiffNss#Ns2.TestVM.Bdl.verified.cs similarity index 83% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.DiffNamespaces#Namespace2.TestVM.BindableDerivedList.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.DiffNss#Ns2.TestVM.Bdl.verified.cs index 2e67d3f4..a62ddd8a 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.DiffNamespaces#Namespace2.TestVM.BindableDerivedList.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.DiffNss#Ns2.TestVM.Bdl.verified.cs @@ -1,4 +1,4 @@ -//HintName: Namespace2.TestVM.BindableDerivedList.g.cs +//HintName: Namespace2.TestVM.BindableDerivedList.g.cs // using System.Collections.ObjectModel; using DynamicData; @@ -9,7 +9,6 @@ namespace Namespace2 { - public partial class TestVM { /// @@ -18,4 +17,4 @@ public partial class TestVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.ComplexGeneric#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.EnumT#BdlAttr.verified.cs similarity index 92% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.ComplexGeneric#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.EnumT#BdlAttr.verified.cs index f529f0cc..1150c13e 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.ComplexGeneric#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.EnumT#BdlAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs // Copyright (c) 2026 .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. diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.EnumType#TestNs.TestVM.BindableDerivedList.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.EnumT#TestNs.TestVM.Bdl.verified.cs similarity index 85% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.EnumType#TestNs.TestVM.BindableDerivedList.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.EnumT#TestNs.TestVM.Bdl.verified.cs index 33eeeff8..ca900426 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.EnumType#TestNs.TestVM.BindableDerivedList.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.EnumT#TestNs.TestVM.Bdl.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.BindableDerivedList.g.cs +//HintName: TestNs.TestVM.BindableDerivedList.g.cs // using System.Collections.ObjectModel; using DynamicData; @@ -9,7 +9,6 @@ namespace TestNs { - public partial class TestVM { /// @@ -18,4 +17,4 @@ public partial class TestVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.AccessModifiers#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.GenClass#BdlAttr.verified.cs similarity index 92% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.AccessModifiers#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.GenClass#BdlAttr.verified.cs index 07ca7a20..2b2de01f 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.AccessModifiers#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.GenClass#BdlAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs // Copyright (c) 2026 .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. diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.GenericClass#TestNs.GenericVM`1.BindableDerivedList.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.GenClass#TestNs.GenVM`1.Bdl.verified.cs similarity index 83% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.GenericClass#TestNs.GenericVM`1.BindableDerivedList.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.GenClass#TestNs.GenVM`1.Bdl.verified.cs index 201d33d6..3458dd34 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.GenericClass#TestNs.GenericVM`1.BindableDerivedList.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.GenClass#TestNs.GenVM`1.Bdl.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.GenericVM`1.BindableDerivedList.g.cs +//HintName: TestNs.GenericVM`1.BindableDerivedList.g.cs // using System.Collections.ObjectModel; using DynamicData; @@ -9,7 +9,6 @@ namespace TestNs { - public partial class GenericVM { /// @@ -18,4 +17,4 @@ public partial class GenericVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.GuidT#BdlAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.GuidT#BdlAttr.verified.cs new file mode 100644 index 00000000..1150c13e --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.GuidT#BdlAttr.verified.cs @@ -0,0 +1,28 @@ +//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs +// Copyright (c) 2026 .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, AllowMultiple = false, Inherited = false)] +internal sealed class BindableDerivedListAttribute : global::System.Attribute +{ + /// + /// Gets the AccessModifier of the BindableDerivedList property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.GuidType#TestNs.TestVM.BindableDerivedList.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.GuidT#TestNs.TestVM.Bdl.verified.cs similarity index 84% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.GuidType#TestNs.TestVM.BindableDerivedList.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.GuidT#TestNs.TestVM.Bdl.verified.cs index 5d417e5a..0462e27b 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.GuidType#TestNs.TestVM.BindableDerivedList.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.GuidT#TestNs.TestVM.Bdl.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.BindableDerivedList.g.cs +//HintName: TestNs.TestVM.BindableDerivedList.g.cs // using System.Collections.ObjectModel; using DynamicData; @@ -9,7 +9,6 @@ namespace TestNs { - public partial class TestVM { /// @@ -18,4 +17,4 @@ public partial class TestVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.IntClassGenPublicProp#BdlAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.IntClassGenPublicProp#BdlAttr.verified.cs new file mode 100644 index 00000000..1150c13e --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.IntClassGenPublicProp#BdlAttr.verified.cs @@ -0,0 +1,28 @@ +//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs +// Copyright (c) 2026 .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, AllowMultiple = false, Inherited = false)] +internal sealed class BindableDerivedListAttribute : global::System.Attribute +{ + /// + /// Gets the AccessModifier of the BindableDerivedList property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.InternalClassGeneratesPublicProperty#TestNs.ViewModel.BindableDerivedList.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.IntClassGenPublicProp#TestNs.Vm.Bdl.verified.cs similarity index 88% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.InternalClassGeneratesPublicProperty#TestNs.ViewModel.BindableDerivedList.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.IntClassGenPublicProp#TestNs.Vm.Bdl.verified.cs index 666ec0d0..e6a21d3a 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.InternalClassGeneratesPublicProperty#TestNs.ViewModel.BindableDerivedList.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.IntClassGenPublicProp#TestNs.Vm.Bdl.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.ViewModel.BindableDerivedList.g.cs +//HintName: TestNs.ViewModel.BindableDerivedList.g.cs // using System.Collections.ObjectModel; using DynamicData; @@ -9,7 +9,6 @@ namespace TestNs { - internal partial class ViewModel { /// diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.InterfaceType#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.InterfaceT#BdlAttr.verified.cs similarity index 92% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.InterfaceType#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.InterfaceT#BdlAttr.verified.cs index 07ca7a20..2b2de01f 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.InterfaceType#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.InterfaceT#BdlAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs // Copyright (c) 2026 .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. diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.InterfaceType#TestNs.TestVM.BindableDerivedList.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.InterfaceT#TestNs.TestVM.Bdl.verified.cs similarity index 89% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.InterfaceType#TestNs.TestVM.BindableDerivedList.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.InterfaceT#TestNs.TestVM.Bdl.verified.cs index 1d65ddce..dc3bb8c0 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.InterfaceType#TestNs.TestVM.BindableDerivedList.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.InterfaceT#TestNs.TestVM.Bdl.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.BindableDerivedList.g.cs +//HintName: TestNs.TestVM.BindableDerivedList.g.cs // using System.Collections.ObjectModel; using DynamicData; @@ -9,7 +9,6 @@ namespace TestNs { - public partial class TestVM { /// @@ -21,4 +20,4 @@ public partial class TestVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.MultiLists#BdlAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.MultiLists#BdlAttr.verified.cs new file mode 100644 index 00000000..1150c13e --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.MultiLists#BdlAttr.verified.cs @@ -0,0 +1,28 @@ +//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs +// Copyright (c) 2026 .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, AllowMultiple = false, Inherited = false)] +internal sealed class BindableDerivedListAttribute : global::System.Attribute +{ + /// + /// Gets the AccessModifier of the BindableDerivedList property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.MultipleLists#TestNs.TestVM.BindableDerivedList.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.MultiLists#TestNs.TestVM.Bdl.verified.cs similarity index 91% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.MultipleLists#TestNs.TestVM.BindableDerivedList.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.MultiLists#TestNs.TestVM.Bdl.verified.cs index e20ef2ea..b8cd09c3 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.MultipleLists#TestNs.TestVM.BindableDerivedList.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.MultiLists#TestNs.TestVM.Bdl.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.BindableDerivedList.g.cs +//HintName: TestNs.TestVM.BindableDerivedList.g.cs // using System.Collections.ObjectModel; using DynamicData; @@ -9,7 +9,6 @@ namespace TestNs { - public partial class TestVM { /// @@ -24,4 +23,4 @@ public partial class TestVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.NestClass#BdlAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.NestClass#BdlAttr.verified.cs new file mode 100644 index 00000000..1150c13e --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.NestClass#BdlAttr.verified.cs @@ -0,0 +1,28 @@ +//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs +// Copyright (c) 2026 .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, AllowMultiple = false, Inherited = false)] +internal sealed class BindableDerivedListAttribute : global::System.Attribute +{ + /// + /// Gets the AccessModifier of the BindableDerivedList property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.NestClass#TestNs.OuterVM+InnerVM+DeepInnerVM.Bdl.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.NestClass#TestNs.OuterVM+InnerVM+DeepInnerVM.Bdl.verified.cs new file mode 100644 index 00000000..2d1f74eb --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.NestClass#TestNs.OuterVM+InnerVM+DeepInnerVM.Bdl.verified.cs @@ -0,0 +1,26 @@ +//HintName: TestNs.OuterVM+InnerVM+DeepInnerVM.BindableDerivedList.g.cs +// +using System.Collections.ObjectModel; +using DynamicData; +using ReactiveUI; + +#pragma warning disable +#nullable enable + +namespace TestNs +{ + public partial class OuterVM + { + public partial class InnerVM + { + public partial class DeepInnerVM + { + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public global::System.Collections.ObjectModel.ReadOnlyObservableCollection? DeepList => _deepList; + } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.NestClass#TestNs.OuterVM+InnerVM.Bdl.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.NestClass#TestNs.OuterVM+InnerVM.Bdl.verified.cs new file mode 100644 index 00000000..319c4fba --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.NestClass#TestNs.OuterVM+InnerVM.Bdl.verified.cs @@ -0,0 +1,23 @@ +//HintName: TestNs.OuterVM+InnerVM.BindableDerivedList.g.cs +// +using System.Collections.ObjectModel; +using DynamicData; +using ReactiveUI; + +#pragma warning disable +#nullable enable + +namespace TestNs +{ + public partial class OuterVM + { + public partial class InnerVM + { + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public global::System.Collections.ObjectModel.ReadOnlyObservableCollection? InnerList => _innerList; + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.NestedClass#TestNs.OuterVM.BindableDerivedList.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.NestClass#TestNs.OuterVM.Bdl.verified.cs similarity index 84% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.NestedClass#TestNs.OuterVM.BindableDerivedList.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.NestClass#TestNs.OuterVM.Bdl.verified.cs index b44a1099..508b63d5 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.NestedClass#TestNs.OuterVM.BindableDerivedList.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.NestClass#TestNs.OuterVM.Bdl.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.OuterVM.BindableDerivedList.g.cs +//HintName: TestNs.OuterVM.BindableDerivedList.g.cs // using System.Collections.ObjectModel; using DynamicData; @@ -9,7 +9,6 @@ namespace TestNs { - public partial class OuterVM { /// @@ -18,4 +17,4 @@ public partial class OuterVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.NullElements#BdlAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.NullElements#BdlAttr.verified.cs new file mode 100644 index 00000000..1150c13e --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.NullElements#BdlAttr.verified.cs @@ -0,0 +1,28 @@ +//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs +// Copyright (c) 2026 .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, AllowMultiple = false, Inherited = false)] +internal sealed class BindableDerivedListAttribute : global::System.Attribute +{ + /// + /// Gets the AccessModifier of the BindableDerivedList property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.NullableElements#TestNs.TestVM.BindableDerivedList.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.NullElements#TestNs.TestVM.Bdl.verified.cs similarity index 85% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.NullableElements#TestNs.TestVM.BindableDerivedList.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.NullElements#TestNs.TestVM.Bdl.verified.cs index 9ddf0bfe..cc7bff77 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.NullableElements#TestNs.TestVM.BindableDerivedList.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.NullElements#TestNs.TestVM.Bdl.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.BindableDerivedList.g.cs +//HintName: TestNs.TestVM.BindableDerivedList.g.cs // using System.Collections.ObjectModel; using DynamicData; @@ -9,7 +9,6 @@ namespace TestNs { - public partial class TestVM { /// @@ -18,4 +17,4 @@ public partial class TestVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.RecordClass#BdlAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.RecordClass#BdlAttr.verified.cs new file mode 100644 index 00000000..1150c13e --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.RecordClass#BdlAttr.verified.cs @@ -0,0 +1,28 @@ +//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs +// Copyright (c) 2026 .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, AllowMultiple = false, Inherited = false)] +internal sealed class BindableDerivedListAttribute : global::System.Attribute +{ + /// + /// Gets the AccessModifier of the BindableDerivedList property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.RecordClass#TestNs.TestVMRecord.BindableDerivedList.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.RecordClass#TestNs.TestVMRecord.Bdl.verified.cs similarity index 88% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.RecordClass#TestNs.TestVMRecord.BindableDerivedList.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.RecordClass#TestNs.TestVMRecord.Bdl.verified.cs index 4146e6ba..232de777 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.RecordClass#TestNs.TestVMRecord.BindableDerivedList.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.RecordClass#TestNs.TestVMRecord.Bdl.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVMRecord.BindableDerivedList.g.cs +//HintName: TestNs.TestVMRecord.BindableDerivedList.g.cs // using System.Collections.ObjectModel; using DynamicData; @@ -9,7 +9,6 @@ namespace TestNs { - public partial record TestVMRecord { /// @@ -21,4 +20,4 @@ public partial record TestVMRecord } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.StructT#BdlAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.StructT#BdlAttr.verified.cs new file mode 100644 index 00000000..2b2de01f --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.StructT#BdlAttr.verified.cs @@ -0,0 +1,28 @@ +//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs +// Copyright (c) 2026 .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, AllowMultiple = false, Inherited = false)] +internal sealed class BindableDerivedListAttribute : global::System.Attribute +{ + /// + /// Gets the AccessModifier of the BindableDerivedList property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.StructType#TestNs.TestVM.BindableDerivedList.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.StructT#TestNs.TestVM.Bdl.verified.cs similarity index 84% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.StructType#TestNs.TestVM.BindableDerivedList.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.StructT#TestNs.TestVM.Bdl.verified.cs index b4825acb..cc4dae36 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.StructType#TestNs.TestVM.BindableDerivedList.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.StructT#TestNs.TestVM.Bdl.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.BindableDerivedList.g.cs +//HintName: TestNs.TestVM.BindableDerivedList.g.cs // using System.Collections.ObjectModel; using DynamicData; @@ -9,7 +9,6 @@ namespace TestNs { - public partial class TestVM { /// @@ -18,4 +17,4 @@ public partial class TestVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.TupleT#BdlAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.TupleT#BdlAttr.verified.cs new file mode 100644 index 00000000..1150c13e --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.TupleT#BdlAttr.verified.cs @@ -0,0 +1,28 @@ +//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs +// Copyright (c) 2026 .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, AllowMultiple = false, Inherited = false)] +internal sealed class BindableDerivedListAttribute : global::System.Attribute +{ + /// + /// Gets the AccessModifier of the BindableDerivedList property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.TupleType#TestNs.TestVM.BindableDerivedList.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.TupleT#TestNs.TestVM.Bdl.verified.cs similarity index 84% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.TupleType#TestNs.TestVM.BindableDerivedList.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.TupleT#TestNs.TestVM.Bdl.verified.cs index 54ab92b1..bdc5df28 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.TupleType#TestNs.TestVM.BindableDerivedList.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.TupleT#TestNs.TestVM.Bdl.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.BindableDerivedList.g.cs +//HintName: TestNs.TestVM.BindableDerivedList.g.cs // using System.Collections.ObjectModel; using DynamicData; @@ -9,7 +9,6 @@ namespace TestNs { - public partial class TestVM { /// @@ -18,4 +17,4 @@ public partial class TestVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.WRx#BdlAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.WRx#BdlAttr.verified.cs new file mode 100644 index 00000000..1150c13e --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.WRx#BdlAttr.verified.cs @@ -0,0 +1,28 @@ +//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs +// Copyright (c) 2026 .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, AllowMultiple = false, Inherited = false)] +internal sealed class BindableDerivedListAttribute : global::System.Attribute +{ + /// + /// Gets the AccessModifier of the BindableDerivedList property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.WithReactive#TestNs.TestVM.BindableDerivedList.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.WRx#TestNs.TestVM.Bdl.verified.cs similarity index 89% rename from src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.WithReactive#TestNs.TestVM.BindableDerivedList.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.WRx#TestNs.TestVM.Bdl.verified.cs index feec854c..73d410e2 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.WithReactive#TestNs.TestVM.BindableDerivedList.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DLE.WRx#TestNs.TestVM.Bdl.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.BindableDerivedList.g.cs +//HintName: TestNs.TestVM.BindableDerivedList.g.cs // using System.Collections.ObjectModel; using DynamicData; @@ -9,7 +9,6 @@ namespace TestNs { - public partial class TestVM { /// @@ -21,4 +20,4 @@ public partial class TestVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.GuidType#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.GuidType#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs deleted file mode 100644 index f529f0cc..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.GuidType#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs +++ /dev/null @@ -1,28 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs -// Copyright (c) 2026 .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, AllowMultiple = false, Inherited = false)] -internal sealed class BindableDerivedListAttribute : global::System.Attribute -{ - /// - /// Gets the AccessModifier of the BindableDerivedList property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.InternalClassGeneratesPublicProperty#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.InternalClassGeneratesPublicProperty#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs deleted file mode 100644 index f529f0cc..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.InternalClassGeneratesPublicProperty#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs +++ /dev/null @@ -1,28 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs -// Copyright (c) 2026 .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, AllowMultiple = false, Inherited = false)] -internal sealed class BindableDerivedListAttribute : global::System.Attribute -{ - /// - /// Gets the AccessModifier of the BindableDerivedList property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.MultipleLists#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.MultipleLists#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs deleted file mode 100644 index f529f0cc..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.MultipleLists#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs +++ /dev/null @@ -1,28 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs -// Copyright (c) 2026 .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, AllowMultiple = false, Inherited = false)] -internal sealed class BindableDerivedListAttribute : global::System.Attribute -{ - /// - /// Gets the AccessModifier of the BindableDerivedList property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.NestedClass#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.NestedClass#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs deleted file mode 100644 index f529f0cc..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.NestedClass#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs +++ /dev/null @@ -1,28 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs -// Copyright (c) 2026 .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, AllowMultiple = false, Inherited = false)] -internal sealed class BindableDerivedListAttribute : global::System.Attribute -{ - /// - /// Gets the AccessModifier of the BindableDerivedList property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.NestedClass#TestNs.OuterVM+InnerVM+DeepInnerVM.BindableDerivedList.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.NestedClass#TestNs.OuterVM+InnerVM+DeepInnerVM.BindableDerivedList.g.verified.cs deleted file mode 100644 index 4f05c1b9..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.NestedClass#TestNs.OuterVM+InnerVM+DeepInnerVM.BindableDerivedList.g.verified.cs +++ /dev/null @@ -1,28 +0,0 @@ -//HintName: TestNs.OuterVM+InnerVM+DeepInnerVM.BindableDerivedList.g.cs -// -using System.Collections.ObjectModel; -using DynamicData; -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - public partial class OuterVM -{ -public partial class InnerVM -{ - - public partial class DeepInnerVM - { - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::System.Collections.ObjectModel.ReadOnlyObservableCollection? DeepList => _deepList; - } -} -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.NestedClass#TestNs.OuterVM+InnerVM.BindableDerivedList.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.NestedClass#TestNs.OuterVM+InnerVM.BindableDerivedList.g.verified.cs deleted file mode 100644 index fd893abb..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.NestedClass#TestNs.OuterVM+InnerVM.BindableDerivedList.g.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//HintName: TestNs.OuterVM+InnerVM.BindableDerivedList.g.cs -// -using System.Collections.ObjectModel; -using DynamicData; -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - public partial class OuterVM -{ - - public partial class InnerVM - { - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::System.Collections.ObjectModel.ReadOnlyObservableCollection? InnerList => _innerList; - } -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.NullableElements#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.NullableElements#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs deleted file mode 100644 index f529f0cc..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.NullableElements#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs +++ /dev/null @@ -1,28 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs -// Copyright (c) 2026 .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, AllowMultiple = false, Inherited = false)] -internal sealed class BindableDerivedListAttribute : global::System.Attribute -{ - /// - /// Gets the AccessModifier of the BindableDerivedList property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.RecordClass#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.RecordClass#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs deleted file mode 100644 index f529f0cc..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.RecordClass#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs +++ /dev/null @@ -1,28 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs -// Copyright (c) 2026 .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, AllowMultiple = false, Inherited = false)] -internal sealed class BindableDerivedListAttribute : global::System.Attribute -{ - /// - /// Gets the AccessModifier of the BindableDerivedList property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.StructType#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.StructType#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs deleted file mode 100644 index 07ca7a20..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.StructType#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs +++ /dev/null @@ -1,28 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs -// Copyright (c) 2026 .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, AllowMultiple = false, Inherited = false)] -internal sealed class BindableDerivedListAttribute : global::System.Attribute -{ - /// - /// Gets the AccessModifier of the BindableDerivedList property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.TupleType#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.TupleType#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs deleted file mode 100644 index f529f0cc..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.TupleType#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs +++ /dev/null @@ -1,28 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs -// Copyright (c) 2026 .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, AllowMultiple = false, Inherited = false)] -internal sealed class BindableDerivedListAttribute : global::System.Attribute -{ - /// - /// Gets the AccessModifier of the BindableDerivedList property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.WithReactive#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.WithReactive#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs deleted file mode 100644 index f529f0cc..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.WithReactive#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs +++ /dev/null @@ -1,28 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs -// Copyright (c) 2026 .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, AllowMultiple = false, Inherited = false)] -internal sealed class BindableDerivedListAttribute : global::System.Attribute -{ - /// - /// Gets the AccessModifier of the BindableDerivedList property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/GeneratorSnapshot.cs b/src/ReactiveUI.SourceGenerator.Tests/GeneratorSnapshot.cs new file mode 100644 index 00000000..f5e80784 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/GeneratorSnapshot.cs @@ -0,0 +1,285 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System.Collections.Concurrent; +using System.Reflection; +using System.Text; + +namespace ReactiveUI.SourceGenerator.Tests; + +/// Compares a generator run's output with the snapshots stored in the test project. +/// +/// +/// Each generated file is stored as {folder}/{type}.{method}#{hint name}.verified.cs: a //HintName: +/// line, then the generated text. Output that differs from its snapshot, or has none, is written beside it as +/// *.received.cs and fails the test, as does a snapshot the run no longer produces. +/// +/// +/// Set ACCEPT_SNAPSHOTS to 1 or true to write every output over its snapshot and delete snapshots +/// nothing produces. Two tests whose names abbreviate to the same snapshot name fail rather than share snapshots. +/// +/// +internal static class GeneratorSnapshot +{ + /// The environment variable that makes a run write its output over the snapshots. + private const string AcceptVariable = "ACCEPT_SNAPSHOTS"; + + /// The assembly metadata key the test project records its snapshot root under. + private const string DirectoryMetadataKey = "GeneratorSnapshotDirectory"; + + /// The suffix of a stored snapshot. + private const string VerifiedSuffix = ".verified.cs"; + + /// The suffix of the output written beside a snapshot it does not match. + private const string ReceivedSuffix = ".received.cs"; + + /// + /// A generated line carrying the generator's assembly version. It changes with every build of the package, so it + /// is left out of the snapshots. + /// + private const string GeneratedCodeAttributeLine = "[global::System.CodeDom.Compiler.GeneratedCode(\""; + + /// The suffix a test class name ends with, dropped from the snapshot name. + private const string TestClassSuffix = "Tests"; + + /// The suffix every generated hint name ends with, dropped from the snapshot name. + private const string HintSuffix = ".g.cs"; + + /// The encoding snapshots are written in: UTF-8 without a byte order mark, as every file in the repository is. + private static readonly UTF8Encoding SnapshotEncoding = new(encoderShouldEmitUTF8Identifier: false); + + /// + /// The words shortened in a snapshot's method and hint segments, longest first so a longer word is never split by a + /// shorter one. They keep snapshot paths well inside the Windows path limit. + /// + private static readonly (string Word, string Abbreviation)[] Abbreviations = + [ + ("ReactiveUI.SourceGenerators.", string.Empty), + ("CancellationToken", "Ct"), + ("ReactiveCommand", "RxCmd"), + ("ReactiveObject", "RxObj"), + ("ReactiveCollection", "RxColl"), + ("BindableDerivedList", "Bdl"), + ("ObservableCollection", "ObsColl"), + ("ReadOnly", "Ro"), + ("Observable", "Obs"), + ("Properties", "Props"), + ("Property", "Prop"), + ("Reactive", "Rx"), + ("Attribute", "Attr"), + ("Collection", "Coll"), + ("Command", "Cmd"), + ("Generic", "Gen"), + ("Generates", "Gen"), + ("Nullable", "Null"), + ("Parameter", "Param"), + ("Namespace", "Ns"), + ("Multiple", "Multi"), + ("ViewModel", "Vm"), + ("IViewFor", "Ivf"), + ("Internal", "Int"), + ("Inheritance", "Inh"), + ("Modifier", "Mod"), + ("Access", "Acc"), + ("Nested", "Nest"), + ("Different", "Diff"), + ("Complex", "Cplx"), + ("Return", "Ret"), + ("Type", "T"), + ("With", "W"), + ("From", "F"), + ("And", string.Empty), + ]; + + /// The directory holding the snapshot folders. + private static readonly string SnapshotRoot = ReadSnapshotRoot(); + + /// Whether this run writes its output over the snapshots. + private static readonly bool Accept = ReadAccept(); + + /// The test that claimed each snapshot prefix, so two tests abbreviating to one name are caught. + private static readonly ConcurrentDictionary PrefixOwners = new(StringComparer.Ordinal); + + /// Asserts that the generated files match the stored snapshots. + /// The driver after the generator has run. + /// The snapshot folder, one per generator. + /// The snapshot name's type segment. + /// The snapshot name's method segment. + /// A task that completes once every file has been compared. + internal static async Task VerifyAsync(GeneratorDriver driver, string folder, string typeName, string methodName) + { + ArgumentNullException.ThrowIfNull(driver); + + var directory = Path.Combine(SnapshotRoot, folder); + _ = Directory.CreateDirectory(directory); + + var prefix = $"{AbbreviateTypeName(typeName)}.{Abbreviate(methodName)}#"; + var test = $"{typeName}.{methodName}"; + var owner = PrefixOwners.GetOrAdd($"{folder}/{prefix}", test); + if (!string.Equals(owner, test, StringComparison.Ordinal)) + { + throw new InvalidOperationException( + $"{test} and {owner} both abbreviate to the snapshot name {folder}/{prefix}; rename one of them or add an abbreviation."); + } + + var produced = new HashSet(StringComparer.Ordinal); + var failures = new List(); + + foreach (var result in driver.GetRunResult().Results) + { + foreach (var source in result.GeneratedSources) + { + var name = prefix + AbbreviateHintName(source.HintName); + _ = produced.Add(name); + + var output = $"//HintName: {source.HintName}\n{Scrub(source.SourceText.ToString())}"; + if (!await StoreAsync(Path.Combine(directory, name), output)) + { + failures.Add($"{folder}/{name}{VerifiedSuffix} does not match the generated output; see {name}{ReceivedSuffix}"); + } + } + } + + foreach (var snapshot in Directory.EnumerateFiles(directory, $"{prefix}*{VerifiedSuffix}")) + { + var fileName = Path.GetFileName(snapshot); + if (produced.Contains(fileName[..^VerifiedSuffix.Length])) + { + continue; + } + + if (Accept) + { + File.Delete(snapshot); + } + else + { + failures.Add($"{folder}/{fileName} is no longer generated"); + } + } + + await Assert.That(failures).IsEmpty(); + } + + /// Settles one generated file against its snapshot, writing the received or accepted output as needed. + /// The snapshot path without its suffix. + /// The generated output, in snapshot form. + /// when the output equals the snapshot or was accepted as it. + private static async Task StoreAsync(string basePath, string output) + { + var verifiedPath = basePath + VerifiedSuffix; + var receivedPath = basePath + ReceivedSuffix; + + // Compared before accepting, so a matching snapshot keeps its bytes rather than being rewritten. A final line + // break is not significant: some stored snapshots end with one and some do not. + if (File.Exists(verifiedPath) + && string.Equals(Normalize(await File.ReadAllTextAsync(verifiedPath)).TrimEnd('\n'), output.TrimEnd('\n'), StringComparison.Ordinal)) + { + File.Delete(receivedPath); + return true; + } + + if (Accept) + { + await File.WriteAllTextAsync(verifiedPath, output, SnapshotEncoding); + File.Delete(receivedPath); + return true; + } + + await File.WriteAllTextAsync(receivedPath, output, SnapshotEncoding); + return false; + } + + /// Reads whether the run accepts its output, from ACCEPT_SNAPSHOTS. + /// when the variable is 1 or true, in any case. + private static bool ReadAccept() + { + var value = Environment.GetEnvironmentVariable(AcceptVariable); + return string.Equals(value, "1", StringComparison.Ordinal) || string.Equals(value, "true", StringComparison.OrdinalIgnoreCase); + } + + /// Reads the snapshot root the test project recorded when it was built. + /// The absolute path of the snapshot root. + /// The test assembly records no snapshot root. + private static string ReadSnapshotRoot() + { + // Recorded at build time: a CI build maps caller file paths to /_/, which does not exist on disk. + foreach (var attribute in typeof(GeneratorSnapshot).Assembly.GetCustomAttributes()) + { + if (attribute.Key == DirectoryMetadataKey && !string.IsNullOrEmpty(attribute.Value)) + { + return attribute.Value; + } + } + + throw new InvalidOperationException($"The test assembly records no '{DirectoryMetadataKey}' assembly metadata."); + } + + /// Shortens a test class name to its capitals, such as RGE for RxGenExtTests. + /// The test class name. + /// The abbreviated name. + /// Each generator's snapshots live in their own folder, so the codes only need to differ within one folder. + private static string AbbreviateTypeName(string typeName) + { + var name = typeName.EndsWith(TestClassSuffix, StringComparison.Ordinal) ? typeName[..^TestClassSuffix.Length] : typeName; + var builder = new StringBuilder(name.Length); + foreach (var character in name) + { + if (char.IsUpper(character) || char.IsDigit(character)) + { + _ = builder.Append(character); + } + } + + return builder.ToString(); + } + + /// Shortens a generated file's hint name: no .g.cs suffix, and the common words abbreviated. + /// The hint name. + /// The abbreviated name. + private static string AbbreviateHintName(string hintName) => + Abbreviate(hintName.EndsWith(HintSuffix, StringComparison.Ordinal) ? hintName[..^HintSuffix.Length] : Path.GetFileNameWithoutExtension(hintName)); + + /// Replaces each common word with its abbreviation. + /// The text to shorten. + /// The shortened text. + private static string Abbreviate(string text) + { + foreach (var (word, abbreviation) in Abbreviations) + { + text = text.Replace(word, abbreviation, StringComparison.Ordinal); + } + + return text; + } + + /// Puts generated text in snapshot form: LF line endings, without the generated-code attribute lines. + /// The generated text. + /// The text as a snapshot stores it. + private static string Scrub(string text) + { + var normalized = Normalize(text); + if (!normalized.Contains(GeneratedCodeAttributeLine, StringComparison.Ordinal)) + { + return normalized; + } + + var builder = new StringBuilder(normalized.Length); + foreach (var line in normalized.Split('\n')) + { + if (!line.Contains(GeneratedCodeAttributeLine, StringComparison.Ordinal)) + { + _ = builder.Append(line).Append('\n'); + } + } + + // Split yields an empty last element after a trailing newline; appending it added one newline too many. + return builder.ToString(0, builder.Length - 1); + } + + /// Normalises line endings so a snapshot compares the same on every checkout. + /// The text to normalise. + /// The text with LF line endings. + private static string Normalize(string text) => text.Replace("\r\n", "\n", StringComparison.Ordinal); +} diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/IViewForGeneratorTests.Basic#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/IVFG.Basic#IvfAttr.verified.cs similarity index 53% rename from src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/IViewForGeneratorTests.Basic#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/IVFG.Basic#IvfAttr.verified.cs index ee889df3..038e227f 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/IViewForGeneratorTests.Basic#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/IVFG.Basic#IvfAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs // Copyright (c) 2026 .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. @@ -18,20 +18,7 @@ namespace ReactiveUI.SourceGenerators; /// /// Type of the view model. [global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IViewForAttribute : global::System.Attribute -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} +internal sealed class IViewForAttribute : global::System.Attribute; /// /// IViewForAttribute. @@ -42,19 +29,6 @@ internal sealed class IViewForAttribute : global::System.Attribute /// /// Type of the view model, ensure to use the full type name including namespace. [global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IViewForAttribute(string? viewModelType) : global::System.Attribute -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} +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/IVIEWFOR/IViewForGeneratorTests.Basic#TestNs.TestViewWpf.IViewFor.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/IVFG.Basic#TestNs.TestViewWpf.Ivf.verified.cs similarity index 78% rename from src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/IViewForGeneratorTests.Basic#TestNs.TestViewWpf.IViewFor.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/IVFG.Basic#TestNs.TestViewWpf.Ivf.verified.cs index 7fcbdc93..438ecd1c 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/IViewForGeneratorTests.Basic#TestNs.TestViewWpf.IViewFor.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/IVFG.Basic#TestNs.TestViewWpf.Ivf.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestViewWpf.IViewFor.g.cs +//HintName: TestNs.TestViewWpf.IViewFor.g.cs // using ReactiveUI; using System.Windows; @@ -12,7 +12,7 @@ namespace TestNs /// Partial class for the TestViewWpf which contains ReactiveUI IViewFor initialization. /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public partial class TestViewWpf : IViewFor + public partial class TestViewWpf : global::ReactiveUI.IViewFor { /// /// The view model dependency property. @@ -28,8 +28,8 @@ public partial class TestViewWpf : IViewFor public TestNs.TestViewModel ViewModel { get => (TestNs.TestViewModel)GetValue(ViewModelProperty); set => SetValue(ViewModelProperty, value); } /// - object? IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.TestViewModel)value; } + object? global::ReactiveUI.IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.TestViewModel)value; } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/IViewForGeneratorTests.Basic#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/IViewForGeneratorTests.Basic#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs deleted file mode 100644 index ee04db7b..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/IViewForGeneratorTests.Basic#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//HintName: ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs -// -#pragma warning disable -#nullable enable - -using global::ReactiveUI; -using global::Splat; - -namespace ReactiveUI.SourceGenerators -{ - /// - /// Source-generated registration extensions for ReactiveUI views. - /// - internal static class ReactiveUISourceGeneratorsExtensions - { - public static void RegisterViewsForViewModelsSourceGenerated(this global::Splat.IMutableDependencyResolver resolver) - { - if (resolver is null) throw new global::System.ArgumentNullException(nameof(resolver)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.AllRegOpts#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.DiffNs#IvfAttr.verified.cs similarity index 53% rename from src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.AllRegOpts#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.DiffNs#IvfAttr.verified.cs index ee889df3..038e227f 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.AllRegOpts#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.DiffNs#IvfAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs // Copyright (c) 2026 .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. @@ -18,20 +18,7 @@ namespace ReactiveUI.SourceGenerators; /// /// Type of the view model. [global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IViewForAttribute : global::System.Attribute -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} +internal sealed class IViewForAttribute : global::System.Attribute; /// /// IViewForAttribute. @@ -42,19 +29,6 @@ internal sealed class IViewForAttribute : global::System.Attribute /// /// Type of the view model, ensure to use the full type name including namespace. [global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IViewForAttribute(string? viewModelType) : global::System.Attribute -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} +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/IVIEWFOR/ViewForExtTests.DiffNs#Views.ProductView.IViewFor.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.DiffNs#Views.ProductView.Ivf.verified.cs similarity index 77% rename from src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.DiffNs#Views.ProductView.IViewFor.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.DiffNs#Views.ProductView.Ivf.verified.cs index 05bb18e1..86a15d83 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.DiffNs#Views.ProductView.IViewFor.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.DiffNs#Views.ProductView.Ivf.verified.cs @@ -1,4 +1,4 @@ -//HintName: Views.ProductView.IViewFor.g.cs +//HintName: Views.ProductView.IViewFor.g.cs // using ReactiveUI; using System.Windows; @@ -12,7 +12,7 @@ namespace Views /// Partial class for the ProductView which contains ReactiveUI IViewFor initialization. /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public partial class ProductView : IViewFor + public partial class ProductView : global::ReactiveUI.IViewFor { /// /// The view model dependency property. @@ -28,8 +28,8 @@ public partial class ProductView : IViewFor public ViewModels.ProductViewModel ViewModel { get => (ViewModels.ProductViewModel)GetValue(ViewModelProperty); set => SetValue(ViewModelProperty, value); } /// - object? IViewFor.ViewModel { get => ViewModel; set => ViewModel = (ViewModels.ProductViewModel)value; } + object? global::ReactiveUI.IViewFor.ViewModel { get => ViewModel; set => ViewModel = (ViewModels.ProductViewModel)value; } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.ExtNs#App.Views.ExternalView.IViewFor.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.ExtNs#App.Views.ExternalView.Ivf.verified.cs similarity index 77% rename from src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.ExtNs#App.Views.ExternalView.IViewFor.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.ExtNs#App.Views.ExternalView.Ivf.verified.cs index 412cfcd7..3918ed3c 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.ExtNs#App.Views.ExternalView.IViewFor.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.ExtNs#App.Views.ExternalView.Ivf.verified.cs @@ -1,4 +1,4 @@ -//HintName: App.Views.ExternalView.IViewFor.g.cs +//HintName: App.Views.ExternalView.IViewFor.g.cs // using ReactiveUI; using System.Windows; @@ -12,7 +12,7 @@ namespace App.Views /// Partial class for the ExternalView which contains ReactiveUI IViewFor initialization. /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public partial class ExternalView : IViewFor + public partial class ExternalView : global::ReactiveUI.IViewFor { /// /// The view model dependency property. @@ -28,8 +28,8 @@ public partial class ExternalView : IViewFor (External.ViewModels.ExternalViewModel)GetValue(ViewModelProperty); set => SetValue(ViewModelProperty, value); } /// - object? IViewFor.ViewModel { get => ViewModel; set => ViewModel = (External.ViewModels.ExternalViewModel)value; } + object? global::ReactiveUI.IViewFor.ViewModel { get => ViewModel; set => ViewModel = (External.ViewModels.ExternalViewModel)value; } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Constant#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.ExtNs#IvfAttr.verified.cs similarity index 53% rename from src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Constant#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.ExtNs#IvfAttr.verified.cs index ee889df3..038e227f 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Constant#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.ExtNs#IvfAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs // Copyright (c) 2026 .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. @@ -18,20 +18,7 @@ namespace ReactiveUI.SourceGenerators; /// /// Type of the view model. [global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IViewForAttribute : global::System.Attribute -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} +internal sealed class IViewForAttribute : global::System.Attribute; /// /// IViewForAttribute. @@ -42,19 +29,6 @@ internal sealed class IViewForAttribute : global::System.Attribute /// /// Type of the view model, ensure to use the full type name including namespace. [global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IViewForAttribute(string? viewModelType) : global::System.Attribute -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} +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/IVIEWFOR/ViewForExtTests.DiffNs#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FIvfWNestViewClass#IvfAttr.verified.cs similarity index 53% rename from src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.DiffNs#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FIvfWNestViewClass#IvfAttr.verified.cs index ee889df3..038e227f 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.DiffNs#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FIvfWNestViewClass#IvfAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs // Copyright (c) 2026 .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. @@ -18,20 +18,7 @@ namespace ReactiveUI.SourceGenerators; /// /// Type of the view model. [global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IViewForAttribute : global::System.Attribute -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} +internal sealed class IViewForAttribute : global::System.Attribute; /// /// IViewForAttribute. @@ -42,19 +29,6 @@ internal sealed class IViewForAttribute : global::System.Attribute /// /// Type of the view model, ensure to use the full type name including namespace. [global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IViewForAttribute(string? viewModelType) : global::System.Attribute -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} +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/IVIEWFOR/VFE.FIvfWNestViewClass#TestNs.OuterContainer+MiddleContainer+NestView.Ivf.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FIvfWNestViewClass#TestNs.OuterContainer+MiddleContainer+NestView.Ivf.verified.cs new file mode 100644 index 00000000..2cc7e844 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FIvfWNestViewClass#TestNs.OuterContainer+MiddleContainer+NestView.Ivf.verified.cs @@ -0,0 +1,41 @@ +//HintName: TestNs.OuterContainer+MiddleContainer+NestedView.IViewFor.g.cs +// +using ReactiveUI; +using System.Windows; + +#pragma warning disable +#nullable enable + +namespace TestNs +{ + public partial class OuterContainer + { + public partial class MiddleContainer + { + /// + /// Partial class for the NestedView which contains ReactiveUI IViewFor initialization. + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public partial class NestedView : global::ReactiveUI.IViewFor + { + /// + /// The view model dependency property. + /// + public static readonly DependencyProperty ViewModelProperty = DependencyProperty.Register(nameof(ViewModel), typeof(TestNs.TestViewModel), typeof(NestedView), new PropertyMetadata(null)); + + /// + /// Gets the binding root view model. + /// + public TestNs.TestViewModel BindingRoot => ViewModel; + + /// + public TestNs.TestViewModel ViewModel { get => (TestNs.TestViewModel)GetValue(ViewModelProperty); set => SetValue(ViewModelProperty, value); } + + /// + object? global::ReactiveUI.IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.TestViewModel)value; } + } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FIvfWRxCmdsVm#IvfAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FIvfWRxCmdsVm#IvfAttr.verified.cs new file mode 100644 index 00000000..038e227f --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FIvfWRxCmdsVm#IvfAttr.verified.cs @@ -0,0 +1,34 @@ +//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs +// Copyright (c) 2026 .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, ensure to use the full type name including namespace. +[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/IVIEWFOR/ViewForExtTests.FromIViewForWithReactiveCommandsViewModel#TestNs.CommandsView.IViewFor.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FIvfWRxCmdsVm#TestNs.CmdsView.Ivf.verified.cs similarity index 77% rename from src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithReactiveCommandsViewModel#TestNs.CommandsView.IViewFor.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FIvfWRxCmdsVm#TestNs.CmdsView.Ivf.verified.cs index c0417123..821ddcb0 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithReactiveCommandsViewModel#TestNs.CommandsView.IViewFor.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FIvfWRxCmdsVm#TestNs.CmdsView.Ivf.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.CommandsView.IViewFor.g.cs +//HintName: TestNs.CommandsView.IViewFor.g.cs // using ReactiveUI; using System.Windows; @@ -12,7 +12,7 @@ namespace TestNs /// Partial class for the CommandsView which contains ReactiveUI IViewFor initialization. /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public partial class CommandsView : IViewFor + public partial class CommandsView : global::ReactiveUI.IViewFor { /// /// The view model dependency property. @@ -28,8 +28,8 @@ public partial class CommandsView : IViewFor public TestNs.CommandsViewModel ViewModel { get => (TestNs.CommandsViewModel)GetValue(ViewModelProperty); set => SetValue(ViewModelProperty, value); } /// - object? IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.CommandsViewModel)value; } + object? global::ReactiveUI.IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.CommandsViewModel)value; } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FIvfWRxPropsVm#IvfAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FIvfWRxPropsVm#IvfAttr.verified.cs new file mode 100644 index 00000000..038e227f --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FIvfWRxPropsVm#IvfAttr.verified.cs @@ -0,0 +1,34 @@ +//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs +// Copyright (c) 2026 .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, ensure to use the full type name including namespace. +[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/IVIEWFOR/ViewForExtTests.FromIViewForWithReactivePropertiesViewModel#TestNs.ReactivePropertiesView.IViewFor.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FIvfWRxPropsVm#TestNs.RxPropsView.Ivf.verified.cs similarity index 76% rename from src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithReactivePropertiesViewModel#TestNs.ReactivePropertiesView.IViewFor.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FIvfWRxPropsVm#TestNs.RxPropsView.Ivf.verified.cs index f24a0019..50a6e70f 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithReactivePropertiesViewModel#TestNs.ReactivePropertiesView.IViewFor.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FIvfWRxPropsVm#TestNs.RxPropsView.Ivf.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.ReactivePropertiesView.IViewFor.g.cs +//HintName: TestNs.ReactivePropertiesView.IViewFor.g.cs // using ReactiveUI; using System.Windows; @@ -12,7 +12,7 @@ namespace TestNs /// Partial class for the ReactivePropertiesView which contains ReactiveUI IViewFor initialization. /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public partial class ReactivePropertiesView : IViewFor + public partial class ReactivePropertiesView : global::ReactiveUI.IViewFor { /// /// The view model dependency property. @@ -28,8 +28,8 @@ public partial class ReactivePropertiesView : IViewFor (TestNs.ReactivePropertiesViewModel)GetValue(ViewModelProperty); set => SetValue(ViewModelProperty, value); } /// - object? IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.ReactivePropertiesViewModel)value; } + object? global::ReactiveUI.IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.ReactivePropertiesViewModel)value; } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FIvfWStringVmT#IvfAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FIvfWStringVmT#IvfAttr.verified.cs new file mode 100644 index 00000000..038e227f --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FIvfWStringVmT#IvfAttr.verified.cs @@ -0,0 +1,34 @@ +//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs +// Copyright (c) 2026 .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, ensure to use the full type name including namespace. +[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/IVIEWFOR/ViewForExtTests.LazySingle#TestNs.TestView.IViewFor.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FIvfWStringVmT#TestNs.TestView.Ivf.verified.cs similarity index 78% rename from src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.LazySingle#TestNs.TestView.IViewFor.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FIvfWStringVmT#TestNs.TestView.Ivf.verified.cs index cf05cbc2..1db5c03c 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.LazySingle#TestNs.TestView.IViewFor.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FIvfWStringVmT#TestNs.TestView.Ivf.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestView.IViewFor.g.cs +//HintName: TestNs.TestView.IViewFor.g.cs // using ReactiveUI; using System.Windows; @@ -12,7 +12,7 @@ namespace TestNs /// Partial class for the TestView which contains ReactiveUI IViewFor initialization. /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public partial class TestView : IViewFor + public partial class TestView : global::ReactiveUI.IViewFor { /// /// The view model dependency property. @@ -28,8 +28,8 @@ public partial class TestView : IViewFor public TestNs.TestViewModel ViewModel { get => (TestNs.TestViewModel)GetValue(ViewModelProperty); set => SetValue(ViewModelProperty, value); } /// - object? IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.TestViewModel)value; } + object? global::ReactiveUI.IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.TestViewModel)value; } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FMultiIvfInSameNs#IvfAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FMultiIvfInSameNs#IvfAttr.verified.cs new file mode 100644 index 00000000..038e227f --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FMultiIvfInSameNs#IvfAttr.verified.cs @@ -0,0 +1,34 @@ +//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs +// Copyright (c) 2026 .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, ensure to use the full type name including namespace. +[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/IVIEWFOR/ViewForExtTests.FromMultipleIViewForInSameNamespace#TestNs.View1.IViewFor.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FMultiIvfInSameNs#TestNs.View1.Ivf.verified.cs similarity index 78% rename from src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromMultipleIViewForInSameNamespace#TestNs.View1.IViewFor.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FMultiIvfInSameNs#TestNs.View1.Ivf.verified.cs index ee2f20c5..80d4f71d 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromMultipleIViewForInSameNamespace#TestNs.View1.IViewFor.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FMultiIvfInSameNs#TestNs.View1.Ivf.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.View1.IViewFor.g.cs +//HintName: TestNs.View1.IViewFor.g.cs // using ReactiveUI; using System.Windows; @@ -12,7 +12,7 @@ namespace TestNs /// Partial class for the View1 which contains ReactiveUI IViewFor initialization. /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public partial class View1 : IViewFor + public partial class View1 : global::ReactiveUI.IViewFor { /// /// The view model dependency property. @@ -28,8 +28,8 @@ public partial class View1 : IViewFor public TestNs.ViewModel1 ViewModel { get => (TestNs.ViewModel1)GetValue(ViewModelProperty); set => SetValue(ViewModelProperty, value); } /// - object? IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.ViewModel1)value; } + object? global::ReactiveUI.IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.ViewModel1)value; } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromMultipleIViewForInSameNamespace#TestNs.View2.IViewFor.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FMultiIvfInSameNs#TestNs.View2.Ivf.verified.cs similarity index 78% rename from src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromMultipleIViewForInSameNamespace#TestNs.View2.IViewFor.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FMultiIvfInSameNs#TestNs.View2.Ivf.verified.cs index 4f704a70..77a992c0 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromMultipleIViewForInSameNamespace#TestNs.View2.IViewFor.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FMultiIvfInSameNs#TestNs.View2.Ivf.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.View2.IViewFor.g.cs +//HintName: TestNs.View2.IViewFor.g.cs // using ReactiveUI; using System.Windows; @@ -12,7 +12,7 @@ namespace TestNs /// Partial class for the View2 which contains ReactiveUI IViewFor initialization. /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public partial class View2 : IViewFor + public partial class View2 : global::ReactiveUI.IViewFor { /// /// The view model dependency property. @@ -28,8 +28,8 @@ public partial class View2 : IViewFor public TestNs.ViewModel2 ViewModel { get => (TestNs.ViewModel2)GetValue(ViewModelProperty); set => SetValue(ViewModelProperty, value); } /// - object? IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.ViewModel2)value; } + object? global::ReactiveUI.IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.ViewModel2)value; } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromMultipleIViewForInSameNamespace#TestNs.View3.IViewFor.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FMultiIvfInSameNs#TestNs.View3.Ivf.verified.cs similarity index 78% rename from src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromMultipleIViewForInSameNamespace#TestNs.View3.IViewFor.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FMultiIvfInSameNs#TestNs.View3.Ivf.verified.cs index 2b2f1dbb..b03bd0a7 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromMultipleIViewForInSameNamespace#TestNs.View3.IViewFor.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.FMultiIvfInSameNs#TestNs.View3.Ivf.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.View3.IViewFor.g.cs +//HintName: TestNs.View3.IViewFor.g.cs // using ReactiveUI; using System.Windows; @@ -12,7 +12,7 @@ namespace TestNs /// Partial class for the View3 which contains ReactiveUI IViewFor initialization. /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public partial class View3 : IViewFor + public partial class View3 : global::ReactiveUI.IViewFor { /// /// The view model dependency property. @@ -28,8 +28,8 @@ public partial class View3 : IViewFor public TestNs.ViewModel3 ViewModel { get => (TestNs.ViewModel3)GetValue(ViewModelProperty); set => SetValue(ViewModelProperty, value); } /// - object? IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.ViewModel3)value; } + object? global::ReactiveUI.IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.ViewModel3)value; } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.Gen#IvfAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.Gen#IvfAttr.verified.cs new file mode 100644 index 00000000..038e227f --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.Gen#IvfAttr.verified.cs @@ -0,0 +1,34 @@ +//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs +// Copyright (c) 2026 .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, ensure to use the full type name including namespace. +[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/IVIEWFOR/ViewForExtTests.Generic#TestNs.StringItemView.IViewFor.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.Gen#TestNs.StringItemView.Ivf.verified.cs similarity index 77% rename from src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Generic#TestNs.StringItemView.IViewFor.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.Gen#TestNs.StringItemView.Ivf.verified.cs index cbca5535..932a5d20 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Generic#TestNs.StringItemView.IViewFor.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.Gen#TestNs.StringItemView.Ivf.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.StringItemView.IViewFor.g.cs +//HintName: TestNs.StringItemView.IViewFor.g.cs // using ReactiveUI; using System.Windows; @@ -12,7 +12,7 @@ namespace TestNs /// Partial class for the StringItemView which contains ReactiveUI IViewFor initialization. /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public partial class StringItemView : IViewFor> + public partial class StringItemView : global::ReactiveUI.IViewFor> { /// /// The view model dependency property. @@ -28,8 +28,8 @@ public partial class StringItemView : IViewFor> public TestNs.GenericViewModel ViewModel { get => (TestNs.GenericViewModel)GetValue(ViewModelProperty); set => SetValue(ViewModelProperty, value); } /// - object? IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.GenericViewModel)value; } + object? global::ReactiveUI.IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.GenericViewModel)value; } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.Interface#IvfAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.Interface#IvfAttr.verified.cs new file mode 100644 index 00000000..038e227f --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.Interface#IvfAttr.verified.cs @@ -0,0 +1,34 @@ +//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs +// Copyright (c) 2026 .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, ensure to use the full type name including namespace. +[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/IVIEWFOR/ViewForExtTests.Interface#TestNs.InterfaceView.IViewFor.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.Interface#TestNs.InterfaceView.Ivf.verified.cs similarity index 77% rename from src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Interface#TestNs.InterfaceView.IViewFor.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.Interface#TestNs.InterfaceView.Ivf.verified.cs index 5a45ea87..fd0699be 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Interface#TestNs.InterfaceView.IViewFor.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.Interface#TestNs.InterfaceView.Ivf.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.InterfaceView.IViewFor.g.cs +//HintName: TestNs.InterfaceView.IViewFor.g.cs // using ReactiveUI; using System.Windows; @@ -12,7 +12,7 @@ namespace TestNs /// Partial class for the InterfaceView which contains ReactiveUI IViewFor initialization. /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public partial class InterfaceView : IViewFor + public partial class InterfaceView : global::ReactiveUI.IViewFor { /// /// The view model dependency property. @@ -28,8 +28,8 @@ public partial class InterfaceView : IViewFor public TestNs.ITestViewModel ViewModel { get => (TestNs.ITestViewModel)GetValue(ViewModelProperty); set => SetValue(ViewModelProperty, value); } /// - object? IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.ITestViewModel)value; } + object? global::ReactiveUI.IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.ITestViewModel)value; } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.Nest#IvfAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.Nest#IvfAttr.verified.cs new file mode 100644 index 00000000..038e227f --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.Nest#IvfAttr.verified.cs @@ -0,0 +1,34 @@ +//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs +// Copyright (c) 2026 .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, ensure to use the full type name including namespace. +[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/IVIEWFOR/ViewForExtTests.Nested#TestNs.ChildView.IViewFor.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.Nest#TestNs.ChildView.Ivf.verified.cs similarity index 77% rename from src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Nested#TestNs.ChildView.IViewFor.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.Nest#TestNs.ChildView.Ivf.verified.cs index 6a228272..0c921f68 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Nested#TestNs.ChildView.IViewFor.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.Nest#TestNs.ChildView.Ivf.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.ChildView.IViewFor.g.cs +//HintName: TestNs.ChildView.IViewFor.g.cs // using ReactiveUI; using System.Windows; @@ -12,7 +12,7 @@ namespace TestNs /// Partial class for the ChildView which contains ReactiveUI IViewFor initialization. /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public partial class ChildView : IViewFor + public partial class ChildView : global::ReactiveUI.IViewFor { /// /// The view model dependency property. @@ -28,8 +28,8 @@ public partial class ChildView : IViewFor public TestNs.ParentViewModel.ChildViewModel ViewModel { get => (TestNs.ParentViewModel.ChildViewModel)GetValue(ViewModelProperty); set => SetValue(ViewModelProperty, value); } /// - object? IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.ParentViewModel.ChildViewModel)value; } + object? global::ReactiveUI.IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.ParentViewModel.ChildViewModel)value; } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.Record#IvfAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.Record#IvfAttr.verified.cs new file mode 100644 index 00000000..038e227f --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.Record#IvfAttr.verified.cs @@ -0,0 +1,34 @@ +//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs +// Copyright (c) 2026 .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, ensure to use the full type name including namespace. +[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/IVIEWFOR/ViewForExtTests.Record#TestNs.RecordView.IViewFor.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.Record#TestNs.RecordView.Ivf.verified.cs similarity index 78% rename from src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Record#TestNs.RecordView.IViewFor.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.Record#TestNs.RecordView.Ivf.verified.cs index d442e6f9..8698c49e 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Record#TestNs.RecordView.IViewFor.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/VFE.Record#TestNs.RecordView.Ivf.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.RecordView.IViewFor.g.cs +//HintName: TestNs.RecordView.IViewFor.g.cs // using ReactiveUI; using System.Windows; @@ -12,7 +12,7 @@ namespace TestNs /// Partial class for the RecordView which contains ReactiveUI IViewFor initialization. /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public partial class RecordView : IViewFor + public partial class RecordView : global::ReactiveUI.IViewFor { /// /// The view model dependency property. @@ -28,8 +28,8 @@ public partial class RecordView : IViewFor public TestNs.RecordViewModel ViewModel { get => (TestNs.RecordViewModel)GetValue(ViewModelProperty); set => SetValue(ViewModelProperty, value); } /// - object? IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.RecordViewModel)value; } + object? global::ReactiveUI.IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.RecordViewModel)value; } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.AllRegOpts#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.AllRegOpts#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs deleted file mode 100644 index 08cdb68c..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.AllRegOpts#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//HintName: ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs -// -#pragma warning disable -#nullable enable - -using global::ReactiveUI; -using global::Splat; - -namespace ReactiveUI.SourceGenerators -{ - /// - /// Source-generated registration extensions for ReactiveUI views. - /// - internal static class ReactiveUISourceGeneratorsExtensions - { - public static void RegisterViewsForViewModelsSourceGenerated(this global::Splat.IMutableDependencyResolver resolver) - { - if (resolver is null) throw new global::System.ArgumentNullException(nameof(resolver)); - resolver.RegisterConstant>(new global::TestNs.FullView()); - resolver.Register(); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.AllRegOpts#TestNs.FullView.IViewFor.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.AllRegOpts#TestNs.FullView.IViewFor.g.verified.cs deleted file mode 100644 index a0351071..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.AllRegOpts#TestNs.FullView.IViewFor.g.verified.cs +++ /dev/null @@ -1,35 +0,0 @@ -//HintName: TestNs.FullView.IViewFor.g.cs -// -using ReactiveUI; -using System.Windows; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - /// - /// Partial class for the FullView which contains ReactiveUI IViewFor initialization. - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public partial class FullView : IViewFor - { - /// - /// The view model dependency property. - /// - public static readonly DependencyProperty ViewModelProperty = DependencyProperty.Register(nameof(ViewModel), typeof(TestNs.FullViewModel), typeof(FullView), new PropertyMetadata(null)); - - /// - /// Gets the binding root view model. - /// - public TestNs.FullViewModel BindingRoot => ViewModel; - - /// - public TestNs.FullViewModel ViewModel { get => (TestNs.FullViewModel)GetValue(ViewModelProperty); set => SetValue(ViewModelProperty, value); } - - /// - object? IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.FullViewModel)value; } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Constant#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Constant#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs deleted file mode 100644 index c6758a7c..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Constant#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs +++ /dev/null @@ -1,24 +0,0 @@ -//HintName: ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs -// -#pragma warning disable -#nullable enable - -using global::ReactiveUI; -using global::Splat; - -namespace ReactiveUI.SourceGenerators -{ - /// - /// Source-generated registration extensions for ReactiveUI views. - /// - internal static class ReactiveUISourceGeneratorsExtensions - { - public static void RegisterViewsForViewModelsSourceGenerated(this global::Splat.IMutableDependencyResolver resolver) - { - if (resolver is null) throw new global::System.ArgumentNullException(nameof(resolver)); - resolver.RegisterConstant>(new global::TestNs.TestView()); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Constant#TestNs.TestView.IViewFor.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Constant#TestNs.TestView.IViewFor.g.verified.cs deleted file mode 100644 index cf05cbc2..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Constant#TestNs.TestView.IViewFor.g.verified.cs +++ /dev/null @@ -1,35 +0,0 @@ -//HintName: TestNs.TestView.IViewFor.g.cs -// -using ReactiveUI; -using System.Windows; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - /// - /// Partial class for the TestView which contains ReactiveUI IViewFor initialization. - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public partial class TestView : IViewFor - { - /// - /// The view model dependency property. - /// - public static readonly DependencyProperty ViewModelProperty = DependencyProperty.Register(nameof(ViewModel), typeof(TestNs.TestViewModel), typeof(TestView), new PropertyMetadata(null)); - - /// - /// Gets the binding root view model. - /// - public TestNs.TestViewModel BindingRoot => ViewModel; - - /// - public TestNs.TestViewModel ViewModel { get => (TestNs.TestViewModel)GetValue(ViewModelProperty); set => SetValue(ViewModelProperty, value); } - - /// - object? IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.TestViewModel)value; } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.DiffNs#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.DiffNs#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs deleted file mode 100644 index ee04db7b..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.DiffNs#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//HintName: ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs -// -#pragma warning disable -#nullable enable - -using global::ReactiveUI; -using global::Splat; - -namespace ReactiveUI.SourceGenerators -{ - /// - /// Source-generated registration extensions for ReactiveUI views. - /// - internal static class ReactiveUISourceGeneratorsExtensions - { - public static void RegisterViewsForViewModelsSourceGenerated(this global::Splat.IMutableDependencyResolver resolver) - { - if (resolver is null) throw new global::System.ArgumentNullException(nameof(resolver)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.ExtNs#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.ExtNs#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs deleted file mode 100644 index ee04db7b..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.ExtNs#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//HintName: ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs -// -#pragma warning disable -#nullable enable - -using global::ReactiveUI; -using global::Splat; - -namespace ReactiveUI.SourceGenerators -{ - /// - /// Source-generated registration extensions for ReactiveUI views. - /// - internal static class ReactiveUISourceGeneratorsExtensions - { - public static void RegisterViewsForViewModelsSourceGenerated(this global::Splat.IMutableDependencyResolver resolver) - { - if (resolver is null) throw new global::System.ArgumentNullException(nameof(resolver)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.ExtNs#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.ExtNs#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs deleted file mode 100644 index ee889df3..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.ExtNs#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs +++ /dev/null @@ -1,60 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs -// Copyright (c) 2026 .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 -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} - -/// -/// IViewForAttribute. -/// -/// -/// -/// Initializes a new instance of the class. -/// -/// Type of the view model, ensure to use the full type name including namespace. -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IViewForAttribute(string? viewModelType) : global::System.Attribute -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithNestedViewClass#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithNestedViewClass#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs deleted file mode 100644 index ee04db7b..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithNestedViewClass#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//HintName: ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs -// -#pragma warning disable -#nullable enable - -using global::ReactiveUI; -using global::Splat; - -namespace ReactiveUI.SourceGenerators -{ - /// - /// Source-generated registration extensions for ReactiveUI views. - /// - internal static class ReactiveUISourceGeneratorsExtensions - { - public static void RegisterViewsForViewModelsSourceGenerated(this global::Splat.IMutableDependencyResolver resolver) - { - if (resolver is null) throw new global::System.ArgumentNullException(nameof(resolver)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithNestedViewClass#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithNestedViewClass#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs deleted file mode 100644 index ee889df3..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithNestedViewClass#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs +++ /dev/null @@ -1,60 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs -// Copyright (c) 2026 .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 -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} - -/// -/// IViewForAttribute. -/// -/// -/// -/// Initializes a new instance of the class. -/// -/// Type of the view model, ensure to use the full type name including namespace. -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IViewForAttribute(string? viewModelType) : global::System.Attribute -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithNestedViewClass#TestNs.OuterContainer+MiddleContainer+NestedView.IViewFor.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithNestedViewClass#TestNs.OuterContainer+MiddleContainer+NestedView.IViewFor.g.verified.cs deleted file mode 100644 index 1da30ec8..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithNestedViewClass#TestNs.OuterContainer+MiddleContainer+NestedView.IViewFor.g.verified.cs +++ /dev/null @@ -1,42 +0,0 @@ -//HintName: TestNs.OuterContainer+MiddleContainer+NestedView.IViewFor.g.cs -// -using ReactiveUI; -using System.Windows; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ -public partial class OuterContainer -{ -public partial class MiddleContainer -{ - /// - /// Partial class for the NestedView which contains ReactiveUI IViewFor initialization. - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public partial class NestedView : IViewFor - { - /// - /// The view model dependency property. - /// - public static readonly DependencyProperty ViewModelProperty = DependencyProperty.Register(nameof(ViewModel), typeof(TestNs.TestViewModel), typeof(NestedView), new PropertyMetadata(null)); - - /// - /// Gets the binding root view model. - /// - public TestNs.TestViewModel BindingRoot => ViewModel; - - /// - public TestNs.TestViewModel ViewModel { get => (TestNs.TestViewModel)GetValue(ViewModelProperty); set => SetValue(ViewModelProperty, value); } - - /// - object? IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.TestViewModel)value; } - } - -} -} -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithReactiveCommandsViewModel#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithReactiveCommandsViewModel#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs deleted file mode 100644 index ee04db7b..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithReactiveCommandsViewModel#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//HintName: ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs -// -#pragma warning disable -#nullable enable - -using global::ReactiveUI; -using global::Splat; - -namespace ReactiveUI.SourceGenerators -{ - /// - /// Source-generated registration extensions for ReactiveUI views. - /// - internal static class ReactiveUISourceGeneratorsExtensions - { - public static void RegisterViewsForViewModelsSourceGenerated(this global::Splat.IMutableDependencyResolver resolver) - { - if (resolver is null) throw new global::System.ArgumentNullException(nameof(resolver)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithReactiveCommandsViewModel#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithReactiveCommandsViewModel#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs deleted file mode 100644 index ee889df3..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithReactiveCommandsViewModel#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs +++ /dev/null @@ -1,60 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs -// Copyright (c) 2026 .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 -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} - -/// -/// IViewForAttribute. -/// -/// -/// -/// Initializes a new instance of the class. -/// -/// Type of the view model, ensure to use the full type name including namespace. -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IViewForAttribute(string? viewModelType) : global::System.Attribute -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithReactivePropertiesViewModel#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithReactivePropertiesViewModel#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs deleted file mode 100644 index ee04db7b..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithReactivePropertiesViewModel#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//HintName: ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs -// -#pragma warning disable -#nullable enable - -using global::ReactiveUI; -using global::Splat; - -namespace ReactiveUI.SourceGenerators -{ - /// - /// Source-generated registration extensions for ReactiveUI views. - /// - internal static class ReactiveUISourceGeneratorsExtensions - { - public static void RegisterViewsForViewModelsSourceGenerated(this global::Splat.IMutableDependencyResolver resolver) - { - if (resolver is null) throw new global::System.ArgumentNullException(nameof(resolver)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithReactivePropertiesViewModel#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithReactivePropertiesViewModel#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs deleted file mode 100644 index ee889df3..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithReactivePropertiesViewModel#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs +++ /dev/null @@ -1,60 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs -// Copyright (c) 2026 .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 -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} - -/// -/// IViewForAttribute. -/// -/// -/// -/// Initializes a new instance of the class. -/// -/// Type of the view model, ensure to use the full type name including namespace. -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IViewForAttribute(string? viewModelType) : global::System.Attribute -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithStringViewModelType#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithStringViewModelType#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs deleted file mode 100644 index ee04db7b..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithStringViewModelType#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//HintName: ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs -// -#pragma warning disable -#nullable enable - -using global::ReactiveUI; -using global::Splat; - -namespace ReactiveUI.SourceGenerators -{ - /// - /// Source-generated registration extensions for ReactiveUI views. - /// - internal static class ReactiveUISourceGeneratorsExtensions - { - public static void RegisterViewsForViewModelsSourceGenerated(this global::Splat.IMutableDependencyResolver resolver) - { - if (resolver is null) throw new global::System.ArgumentNullException(nameof(resolver)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithStringViewModelType#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithStringViewModelType#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs deleted file mode 100644 index ee889df3..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithStringViewModelType#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs +++ /dev/null @@ -1,60 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs -// Copyright (c) 2026 .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 -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} - -/// -/// IViewForAttribute. -/// -/// -/// -/// Initializes a new instance of the class. -/// -/// Type of the view model, ensure to use the full type name including namespace. -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IViewForAttribute(string? viewModelType) : global::System.Attribute -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithStringViewModelType#TestNs.TestView.IViewFor.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithStringViewModelType#TestNs.TestView.IViewFor.g.verified.cs deleted file mode 100644 index cf05cbc2..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithStringViewModelType#TestNs.TestView.IViewFor.g.verified.cs +++ /dev/null @@ -1,35 +0,0 @@ -//HintName: TestNs.TestView.IViewFor.g.cs -// -using ReactiveUI; -using System.Windows; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - /// - /// Partial class for the TestView which contains ReactiveUI IViewFor initialization. - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public partial class TestView : IViewFor - { - /// - /// The view model dependency property. - /// - public static readonly DependencyProperty ViewModelProperty = DependencyProperty.Register(nameof(ViewModel), typeof(TestNs.TestViewModel), typeof(TestView), new PropertyMetadata(null)); - - /// - /// Gets the binding root view model. - /// - public TestNs.TestViewModel BindingRoot => ViewModel; - - /// - public TestNs.TestViewModel ViewModel { get => (TestNs.TestViewModel)GetValue(ViewModelProperty); set => SetValue(ViewModelProperty, value); } - - /// - object? IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.TestViewModel)value; } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithViewModelRegistration#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithViewModelRegistration#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs deleted file mode 100644 index 9b9b7c89..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithViewModelRegistration#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//HintName: ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs -// -#pragma warning disable -#nullable enable - -using global::ReactiveUI; -using global::Splat; - -namespace ReactiveUI.SourceGenerators -{ - /// - /// Source-generated registration extensions for ReactiveUI views. - /// - internal static class ReactiveUISourceGeneratorsExtensions - { - public static void RegisterViewsForViewModelsSourceGenerated(this global::Splat.IMutableDependencyResolver resolver) - { - if (resolver is null) throw new global::System.ArgumentNullException(nameof(resolver)); - resolver.RegisterLazySingleton>(() => new global::TestNs.TestView()); - resolver.RegisterLazySingleton(() => new global::TestNs.TestViewModel()); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithViewModelRegistration#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithViewModelRegistration#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs deleted file mode 100644 index ee889df3..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithViewModelRegistration#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs +++ /dev/null @@ -1,60 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs -// Copyright (c) 2026 .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 -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} - -/// -/// IViewForAttribute. -/// -/// -/// -/// Initializes a new instance of the class. -/// -/// Type of the view model, ensure to use the full type name including namespace. -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IViewForAttribute(string? viewModelType) : global::System.Attribute -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithViewModelRegistration#TestNs.TestView.IViewFor.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithViewModelRegistration#TestNs.TestView.IViewFor.g.verified.cs deleted file mode 100644 index cf05cbc2..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromIViewForWithViewModelRegistration#TestNs.TestView.IViewFor.g.verified.cs +++ /dev/null @@ -1,35 +0,0 @@ -//HintName: TestNs.TestView.IViewFor.g.cs -// -using ReactiveUI; -using System.Windows; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - /// - /// Partial class for the TestView which contains ReactiveUI IViewFor initialization. - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public partial class TestView : IViewFor - { - /// - /// The view model dependency property. - /// - public static readonly DependencyProperty ViewModelProperty = DependencyProperty.Register(nameof(ViewModel), typeof(TestNs.TestViewModel), typeof(TestView), new PropertyMetadata(null)); - - /// - /// Gets the binding root view model. - /// - public TestNs.TestViewModel BindingRoot => ViewModel; - - /// - public TestNs.TestViewModel ViewModel { get => (TestNs.TestViewModel)GetValue(ViewModelProperty); set => SetValue(ViewModelProperty, value); } - - /// - object? IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.TestViewModel)value; } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromMultipleIViewForInSameNamespace#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromMultipleIViewForInSameNamespace#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs deleted file mode 100644 index e8122464..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromMultipleIViewForInSameNamespace#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs +++ /dev/null @@ -1,24 +0,0 @@ -//HintName: ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs -// -#pragma warning disable -#nullable enable - -using global::ReactiveUI; -using global::Splat; - -namespace ReactiveUI.SourceGenerators -{ - /// - /// Source-generated registration extensions for ReactiveUI views. - /// - internal static class ReactiveUISourceGeneratorsExtensions - { - public static void RegisterViewsForViewModelsSourceGenerated(this global::Splat.IMutableDependencyResolver resolver) - { - if (resolver is null) throw new global::System.ArgumentNullException(nameof(resolver)); - resolver.RegisterLazySingleton>(() => new global::TestNs.View3()); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromMultipleIViewForInSameNamespace#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromMultipleIViewForInSameNamespace#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs deleted file mode 100644 index ee889df3..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.FromMultipleIViewForInSameNamespace#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs +++ /dev/null @@ -1,60 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs -// Copyright (c) 2026 .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 -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} - -/// -/// IViewForAttribute. -/// -/// -/// -/// Initializes a new instance of the class. -/// -/// Type of the view model, ensure to use the full type name including namespace. -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IViewForAttribute(string? viewModelType) : global::System.Attribute -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Generic#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Generic#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs deleted file mode 100644 index ee04db7b..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Generic#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//HintName: ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs -// -#pragma warning disable -#nullable enable - -using global::ReactiveUI; -using global::Splat; - -namespace ReactiveUI.SourceGenerators -{ - /// - /// Source-generated registration extensions for ReactiveUI views. - /// - internal static class ReactiveUISourceGeneratorsExtensions - { - public static void RegisterViewsForViewModelsSourceGenerated(this global::Splat.IMutableDependencyResolver resolver) - { - if (resolver is null) throw new global::System.ArgumentNullException(nameof(resolver)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Generic#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Generic#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs deleted file mode 100644 index ee889df3..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Generic#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs +++ /dev/null @@ -1,60 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs -// Copyright (c) 2026 .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 -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} - -/// -/// IViewForAttribute. -/// -/// -/// -/// Initializes a new instance of the class. -/// -/// Type of the view model, ensure to use the full type name including namespace. -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IViewForAttribute(string? viewModelType) : global::System.Attribute -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Interface#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Interface#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs deleted file mode 100644 index ee04db7b..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Interface#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//HintName: ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs -// -#pragma warning disable -#nullable enable - -using global::ReactiveUI; -using global::Splat; - -namespace ReactiveUI.SourceGenerators -{ - /// - /// Source-generated registration extensions for ReactiveUI views. - /// - internal static class ReactiveUISourceGeneratorsExtensions - { - public static void RegisterViewsForViewModelsSourceGenerated(this global::Splat.IMutableDependencyResolver resolver) - { - if (resolver is null) throw new global::System.ArgumentNullException(nameof(resolver)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Interface#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Interface#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs deleted file mode 100644 index ee889df3..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Interface#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs +++ /dev/null @@ -1,60 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs -// Copyright (c) 2026 .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 -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} - -/// -/// IViewForAttribute. -/// -/// -/// -/// Initializes a new instance of the class. -/// -/// Type of the view model, ensure to use the full type name including namespace. -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IViewForAttribute(string? viewModelType) : global::System.Attribute -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.LazySingle#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.LazySingle#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs deleted file mode 100644 index 09a9a9f1..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.LazySingle#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs +++ /dev/null @@ -1,24 +0,0 @@ -//HintName: ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs -// -#pragma warning disable -#nullable enable - -using global::ReactiveUI; -using global::Splat; - -namespace ReactiveUI.SourceGenerators -{ - /// - /// Source-generated registration extensions for ReactiveUI views. - /// - internal static class ReactiveUISourceGeneratorsExtensions - { - public static void RegisterViewsForViewModelsSourceGenerated(this global::Splat.IMutableDependencyResolver resolver) - { - if (resolver is null) throw new global::System.ArgumentNullException(nameof(resolver)); - resolver.RegisterLazySingleton>(() => new global::TestNs.TestView()); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.LazySingle#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.LazySingle#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs deleted file mode 100644 index ee889df3..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.LazySingle#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs +++ /dev/null @@ -1,60 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs -// Copyright (c) 2026 .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 -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} - -/// -/// IViewForAttribute. -/// -/// -/// -/// Initializes a new instance of the class. -/// -/// Type of the view model, ensure to use the full type name including namespace. -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IViewForAttribute(string? viewModelType) : global::System.Attribute -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Nested#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Nested#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs deleted file mode 100644 index ee04db7b..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Nested#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//HintName: ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs -// -#pragma warning disable -#nullable enable - -using global::ReactiveUI; -using global::Splat; - -namespace ReactiveUI.SourceGenerators -{ - /// - /// Source-generated registration extensions for ReactiveUI views. - /// - internal static class ReactiveUISourceGeneratorsExtensions - { - public static void RegisterViewsForViewModelsSourceGenerated(this global::Splat.IMutableDependencyResolver resolver) - { - if (resolver is null) throw new global::System.ArgumentNullException(nameof(resolver)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Nested#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Nested#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs deleted file mode 100644 index ee889df3..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Nested#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs +++ /dev/null @@ -1,60 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs -// Copyright (c) 2026 .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 -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} - -/// -/// IViewForAttribute. -/// -/// -/// -/// Initializes a new instance of the class. -/// -/// Type of the view model, ensure to use the full type name including namespace. -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IViewForAttribute(string? viewModelType) : global::System.Attribute -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.PerReq#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.PerReq#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs deleted file mode 100644 index d5913d0c..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.PerReq#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs +++ /dev/null @@ -1,24 +0,0 @@ -//HintName: ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs -// -#pragma warning disable -#nullable enable - -using global::ReactiveUI; -using global::Splat; - -namespace ReactiveUI.SourceGenerators -{ - /// - /// Source-generated registration extensions for ReactiveUI views. - /// - internal static class ReactiveUISourceGeneratorsExtensions - { - public static void RegisterViewsForViewModelsSourceGenerated(this global::Splat.IMutableDependencyResolver resolver) - { - if (resolver is null) throw new global::System.ArgumentNullException(nameof(resolver)); - resolver.Register, global::TestNs.TestView>(); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.PerReq#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.PerReq#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs deleted file mode 100644 index ee889df3..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.PerReq#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs +++ /dev/null @@ -1,60 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs -// Copyright (c) 2026 .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 -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} - -/// -/// IViewForAttribute. -/// -/// -/// -/// Initializes a new instance of the class. -/// -/// Type of the view model, ensure to use the full type name including namespace. -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IViewForAttribute(string? viewModelType) : global::System.Attribute -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.PerReq#TestNs.TestView.IViewFor.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.PerReq#TestNs.TestView.IViewFor.g.verified.cs deleted file mode 100644 index cf05cbc2..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.PerReq#TestNs.TestView.IViewFor.g.verified.cs +++ /dev/null @@ -1,35 +0,0 @@ -//HintName: TestNs.TestView.IViewFor.g.cs -// -using ReactiveUI; -using System.Windows; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - /// - /// Partial class for the TestView which contains ReactiveUI IViewFor initialization. - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public partial class TestView : IViewFor - { - /// - /// The view model dependency property. - /// - public static readonly DependencyProperty ViewModelProperty = DependencyProperty.Register(nameof(ViewModel), typeof(TestNs.TestViewModel), typeof(TestView), new PropertyMetadata(null)); - - /// - /// Gets the binding root view model. - /// - public TestNs.TestViewModel BindingRoot => ViewModel; - - /// - public TestNs.TestViewModel ViewModel { get => (TestNs.TestViewModel)GetValue(ViewModelProperty); set => SetValue(ViewModelProperty, value); } - - /// - object? IViewFor.ViewModel { get => ViewModel; set => ViewModel = (TestNs.TestViewModel)value; } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Record#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Record#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs deleted file mode 100644 index ee04db7b..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Record#ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//HintName: ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs -// -#pragma warning disable -#nullable enable - -using global::ReactiveUI; -using global::Splat; - -namespace ReactiveUI.SourceGenerators -{ - /// - /// Source-generated registration extensions for ReactiveUI views. - /// - internal static class ReactiveUISourceGeneratorsExtensions - { - public static void RegisterViewsForViewModelsSourceGenerated(this global::Splat.IMutableDependencyResolver resolver) - { - if (resolver is null) throw new global::System.ArgumentNullException(nameof(resolver)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Record#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Record#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs deleted file mode 100644 index ee889df3..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/IVIEWFOR/ViewForExtTests.Record#ReactiveUI.SourceGenerators.IViewForAttribute.g.verified.cs +++ /dev/null @@ -1,60 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IViewForAttribute.g.cs -// Copyright (c) 2026 .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 -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} - -/// -/// IViewForAttribute. -/// -/// -/// -/// Initializes a new instance of the class. -/// -/// Type of the view model, ensure to use the full type name including namespace. -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IViewForAttribute(string? viewModelType) : global::System.Attribute -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/ModuleInitializer.cs b/src/ReactiveUI.SourceGenerator.Tests/ModuleInitializer.cs deleted file mode 100644 index 245f0215..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. -// ReactiveUI Association Incorporated licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. - -namespace ReactiveUI.SourceGenerator.Tests; - -/// Initializes the source generator verifiers. -public static class ModuleInitializer -{ - /// Initializes the source generators. - [ModuleInitializer] - public static void Init() => VerifySourceGenerators.Initialize(); -} diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.AttrNullRef#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.AttrNullRef#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.AttrNullRef#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.AttrNullRef#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.AttrNullRef#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs deleted file mode 100644 index e83082da..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.AttrNullRef#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,34 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - - public partial class TestVM - { - /// - private object? _myNamedProperty; - - /// - private ReactiveUI.ObservableAsPropertyHelper? _myNamedPropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.Text.Json.Serialization.JsonIncludeAttribute()] - [global::System.Runtime.Serialization.DataMemberAttribute()] - [global::System.Text.Json.Serialization.JsonIncludeAttribute()] - public object? MyNamedProperty { get => _myNamedProperty = (_myNamedPropertyHelper == null ? _myNamedProperty : _myNamedPropertyHelper.Value); } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - _myNamedPropertyHelper = Test7!.ToProperty(this, nameof(MyNamedProperty)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.AttrRef#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.AttrRef#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.AttrRef#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.AttrRef#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.AttrRef#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs deleted file mode 100644 index 7b1a883d..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.AttrRef#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,34 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - - public partial class TestVM - { - /// - private object _myNamedProperty; - - /// - private ReactiveUI.ObservableAsPropertyHelper? _myNamedPropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.Text.Json.Serialization.JsonIncludeAttribute()] - [global::System.Runtime.Serialization.DataMemberAttribute()] - [global::System.Text.Json.Serialization.JsonIncludeAttribute()] - public object MyNamedProperty { get => _myNamedProperty = _myNamedPropertyHelper?.Value ?? _myNamedProperty; } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - _myNamedPropertyHelper = Test6!.ToProperty(this, nameof(MyNamedProperty)); - } - } -} -#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 deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore 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 deleted file mode 100644 index 318d2020..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - - public partial class TestVM - { - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _testPropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.Runtime.Serialization.DataMemberAttribute()] - [global::System.Text.Json.Serialization.JsonIncludeAttribute()] - public double? TestProperty { get => _testProperty = (_testPropertyHelper == null ? _testProperty : _testPropertyHelper.Value); } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file 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 deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableMethods#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore 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 deleted file mode 100644 index 3c24f8cd..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableMethods#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,31 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - - public partial class TestVM - { - /// - private int _test2Property; - - /// - private ReactiveUI.ObservableAsPropertyHelper? _test2PropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int Test2Property { get => _test2Property = _test2PropertyHelper?.Value ?? _test2Property; } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - _test2PropertyHelper = Test2()!.ToProperty(this, nameof(Test2Property)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file 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 deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableMethodsWithName#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore 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 deleted file mode 100644 index e80caabd..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableMethodsWithName#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,31 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - - public partial class TestVM - { - /// - private int _myNamedProperty; - - /// - private ReactiveUI.ObservableAsPropertyHelper? _myNamedPropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int MyNamedProperty { get => _myNamedProperty = _myNamedPropertyHelper?.Value ?? _myNamedProperty; } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - _myNamedPropertyHelper = Test3()!.ToProperty(this, nameof(MyNamedProperty)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file 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 deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableProp#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore 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 deleted file mode 100644 index e0b9a239..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableProp#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,31 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - - public partial class TestVM - { - /// - private int _test1Property; - - /// - private ReactiveUI.ObservableAsPropertyHelper? _test1PropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int Test1Property { get => _test1Property = _test1PropertyHelper?.Value ?? _test1Property; } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - _test1PropertyHelper = Test1!.ToProperty(this, nameof(Test1Property)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file 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 deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromPartialProperty#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore 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 deleted file mode 100644 index 4d47e86b..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromPartialProperty#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,33 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - - public partial class TestVM - { - /// - private double? _testProperty = 1.1d; - - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _testPropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.Text.Json.Serialization.JsonIncludeAttribute()] - [global::System.Runtime.Serialization.DataMemberAttribute()] - public partial double? TestProperty { get => _testProperty = (_testPropertyHelper == null ? _testProperty : _testPropertyHelper.Value); } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromPartialPropertyWithEmptyStringInitialValue#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromPartialPropertyWithEmptyStringInitialValue#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 2ba75ce7..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromPartialPropertyWithEmptyStringInitialValue#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromPartialPropertyWithEmptyStringInitialValue#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromPartialPropertyWithEmptyStringInitialValue#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs deleted file mode 100644 index 06b00e6d..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromPartialPropertyWithEmptyStringInitialValue#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,31 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - - public partial class TestVM - { - /// - private string _pLCActive = ""; - - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _pLCActiveHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public partial string PLCActive { get => _pLCActive = (_pLCActiveHelper == null ? _pLCActive : _pLCActiveHelper.Value); } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromPartialPropertyWithoutInitialValue#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromPartialPropertyWithoutInitialValue#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 2ba75ce7..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromPartialPropertyWithoutInitialValue#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromPartialPropertyWithoutInitialValue#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromPartialPropertyWithoutInitialValue#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs deleted file mode 100644 index a640e042..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromPartialPropertyWithoutInitialValue#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,40 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - - public partial class TestVM - { - /// - private string _pLCActive = string.Empty; - - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _pLCActiveHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public partial string PLCActive { get => _pLCActive = (_pLCActiveHelper == null ? _pLCActive : _pLCActiveHelper.Value); } -/// - private string? _pLCName; - - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _pLCNameHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public partial string? PLCName { get => _pLCName = (_pLCNameHelper == null ? _pLCName : _pLCNameHelper.Value); } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.Nested#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.Nested#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.Nested#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.Nested#TestNs.TestVM+TestVMInner1.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.Nested#TestNs.TestVM+TestVMInner1.ObservableAsPropertyFromObservable.g.verified.cs deleted file mode 100644 index dca36436..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.Nested#TestNs.TestVM+TestVMInner1.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,35 +0,0 @@ -//HintName: TestNs.TestVM+TestVMInner1.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - public partial class TestVM -{ - - public partial class TestVMInner1 - { - /// - private int _testIn1Property; - - /// - private ReactiveUI.ObservableAsPropertyHelper? _testIn1PropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int TestIn1Property { get => _testIn1Property = _testIn1PropertyHelper?.Value ?? _testIn1Property; } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - _testIn1PropertyHelper = TestIn1!.ToProperty(this, nameof(TestIn1Property)); - } - } -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.Nested#TestNs.TestVM+TestVMInner2+TestVMInner3.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.Nested#TestNs.TestVM+TestVMInner2+TestVMInner3.ObservableAsPropertyFromObservable.g.verified.cs deleted file mode 100644 index 3c245835..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.Nested#TestNs.TestVM+TestVMInner2+TestVMInner3.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,38 +0,0 @@ -//HintName: TestNs.TestVM+TestVMInner2+TestVMInner3.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - public partial class TestVM -{ -public partial class TestVMInner2 -{ - - public partial class TestVMInner3 - { - /// - private int _testIn3Property; - - /// - private ReactiveUI.ObservableAsPropertyHelper? _testIn3PropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int TestIn3Property { get => _testIn3Property = _testIn3PropertyHelper?.Value ?? _testIn3Property; } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - _testIn3PropertyHelper = TestIn3!.ToProperty(this, nameof(TestIn3Property)); - } - } -} -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.Nested#TestNs.TestVM+TestVMInner2.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.Nested#TestNs.TestVM+TestVMInner2.ObservableAsPropertyFromObservable.g.verified.cs deleted file mode 100644 index b1258225..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.Nested#TestNs.TestVM+TestVMInner2.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,35 +0,0 @@ -//HintName: TestNs.TestVM+TestVMInner2.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - public partial class TestVM -{ - - public partial class TestVMInner2 - { - /// - private int _testIn2Property; - - /// - private ReactiveUI.ObservableAsPropertyHelper? _testIn2PropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int TestIn2Property { get => _testIn2Property = _testIn2PropertyHelper?.Value ?? _testIn2Property; } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - _testIn2PropertyHelper = TestIn2!.ToProperty(this, nameof(TestIn2Property)); - } - } -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.Nested#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.Nested#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs deleted file mode 100644 index e0b9a239..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.Nested#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,31 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - - public partial class TestVM - { - /// - private int _test1Property; - - /// - private ReactiveUI.ObservableAsPropertyHelper? _test1PropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int Test1Property { get => _test1Property = _test1PropertyHelper?.Value ?? _test1Property; } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - _test1PropertyHelper = Test1!.ToProperty(this, nameof(Test1Property)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.WithAttr#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.WithAttr#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.WithAttr#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.WithAttr#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.WithAttr#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs deleted file mode 100644 index 5d3d2d6a..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.WithAttr#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,34 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - - public partial class TestVM - { - /// - private int _myNamedProperty; - - /// - private ReactiveUI.ObservableAsPropertyHelper? _myNamedPropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.Text.Json.Serialization.JsonIncludeAttribute()] - [global::System.Runtime.Serialization.DataMemberAttribute()] - [global::System.Text.Json.Serialization.JsonIncludeAttribute()] - public int MyNamedProperty { get => _myNamedProperty = _myNamedPropertyHelper?.Value ?? _myNamedProperty; } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - _myNamedPropertyHelper = Test5!.ToProperty(this, nameof(MyNamedProperty)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.WithName#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.WithName#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.WithName#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.WithName#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.WithName#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs deleted file mode 100644 index 1e5c1f55..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.WithName#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,31 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - - public partial class TestVM - { - /// - private int _myNamedProperty; - - /// - private ReactiveUI.ObservableAsPropertyHelper? _myNamedPropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int MyNamedProperty { get => _myNamedProperty = _myNamedPropertyHelper?.Value ?? _myNamedProperty; } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - _myNamedPropertyHelper = Test4!.ToProperty(this, nameof(MyNamedProperty)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file 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 deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore 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 deleted file mode 100644 index 23682fad..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - - public partial class TestVM - { - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _test1Helper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int Test1 { get => _test1 = _test1Helper?.Value ?? _test1; } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file 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 deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore 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 deleted file mode 100644 index 5221cb69..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM+TestVMInner1.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//HintName: TestNs.TestVM+TestVMInner1.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - public partial class TestVM -{ - - public partial class TestVMInner1 - { - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _testIn1Helper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int TestIn1 { get => _testIn1 = _testIn1Helper?.Value ?? _testIn1; } - } -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file 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 deleted file mode 100644 index 190f193e..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM+TestVMInner2+TestVMInner3.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//HintName: TestNs.TestVM+TestVMInner2+TestVMInner3.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - public partial class TestVM -{ -public partial class TestVMInner2 -{ - - public partial class TestVMInner3 - { - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _testIn3Helper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int TestIn3 { get => _testIn3 = _testIn3Helper?.Value ?? _testIn3; } - } -} -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file 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 deleted file mode 100644 index d8747a92..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM+TestVMInner2.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//HintName: TestNs.TestVM+TestVMInner2.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - public partial class TestVM -{ - - public partial class TestVMInner2 - { - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _testIn2Helper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int TestIn2 { get => _testIn2 = _testIn2Helper?.Value ?? _testIn2; } - } -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file 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 deleted file mode 100644 index 2897a9b2..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - - public partial class TestVM - { - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _test2Helper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int Test2 { get => _test2 = _test2Helper?.Value ?? _test2; } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file 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 deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NamedFromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore 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 deleted file mode 100644 index e96b9824..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NamedFromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - - public partial class TestVM - { - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _test4Helper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int Test4 { get => _test4 = _test4Helper?.Value ?? _test4; } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file 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 deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NonReadOnlyFromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore 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 deleted file mode 100644 index f53f3651..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NonReadOnlyFromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - - public partial class TestVM - { - /// - private ReactiveUI.ObservableAsPropertyHelper? _test3Helper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int Test3 { get => _test3 = _test3Helper?.Value ?? _test3; } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file 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 deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NonReadOnlyFromFieldProtected#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore 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 deleted file mode 100644 index b31d92e4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NonReadOnlyFromFieldProtected#TestNs.TestVM.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - - public partial class TestVM - { - /// - protected readonly ReactiveUI.ObservableAsPropertyHelper _test5Helper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int Test5 { get => _test5 = _test5Helper?.Value ?? _test5; } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInDeeplyNestedClass#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInDeeplyNestedClass#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInDeeplyNestedClass#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInDeeplyNestedClass#TestNs.Level1+Level2+Level3+Level4.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInDeeplyNestedClass#TestNs.Level1+Level2+Level3+Level4.ObservableAsProperties.g.verified.cs deleted file mode 100644 index 36d26d37..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInDeeplyNestedClass#TestNs.Level1+Level2+Level3+Level4.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,29 +0,0 @@ -//HintName: TestNs.Level1+Level2+Level3+Level4.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - public partial class Level1 -{ -public partial class Level2 -{ -public partial class Level3 -{ - - public partial class Level4 - { - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _level4ValueHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int Level4Value { get => _level4Value = _level4ValueHelper?.Value ?? _level4Value; } - } -} -} -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInDeeplyNestedClass#TestNs.Level1+Level2+Level3+Level4.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInDeeplyNestedClass#TestNs.Level1+Level2+Level3+Level4.ObservableAsPropertyFromObservable.g.verified.cs deleted file mode 100644 index 1c3738e4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInDeeplyNestedClass#TestNs.Level1+Level2+Level3+Level4.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,41 +0,0 @@ -//HintName: TestNs.Level1+Level2+Level3+Level4.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - public partial class Level1 -{ -public partial class Level2 -{ -public partial class Level3 -{ - - public partial class Level4 - { - /// - private bool _deepObservableProperty; - - /// - private ReactiveUI.ObservableAsPropertyHelper? _deepObservablePropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public bool DeepObservableProperty { get => _deepObservableProperty = _deepObservablePropertyHelper?.Value ?? _deepObservableProperty; } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - _deepObservablePropertyHelper = DeepObservable!.ToProperty(this, nameof(DeepObservableProperty)); - } - } -} -} -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInDeeplyNestedClass#TestNs.Level1+Level2+Level3.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInDeeplyNestedClass#TestNs.Level1+Level2+Level3.ObservableAsProperties.g.verified.cs deleted file mode 100644 index 0f495d2b..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInDeeplyNestedClass#TestNs.Level1+Level2+Level3.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//HintName: TestNs.Level1+Level2+Level3.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - public partial class Level1 -{ -public partial class Level2 -{ - - public partial class Level3 - { - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _level3ValueHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int Level3Value { get => _level3Value = _level3ValueHelper?.Value ?? _level3Value; } - } -} -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInDeeplyNestedClass#TestNs.Level1+Level2.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInDeeplyNestedClass#TestNs.Level1+Level2.ObservableAsProperties.g.verified.cs deleted file mode 100644 index 072b2420..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInDeeplyNestedClass#TestNs.Level1+Level2.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//HintName: TestNs.Level1+Level2.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - public partial class Level1 -{ - - public partial class Level2 - { - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _level2ValueHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int Level2Value { get => _level2Value = _level2ValueHelper?.Value ?? _level2Value; } - } -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInDeeplyNestedClass#TestNs.Level1+Level2.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInDeeplyNestedClass#TestNs.Level1+Level2.ObservableAsPropertyFromObservable.g.verified.cs deleted file mode 100644 index a31f90bd..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInDeeplyNestedClass#TestNs.Level1+Level2.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,35 +0,0 @@ -//HintName: TestNs.Level1+Level2.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - public partial class Level1 -{ - - public partial class Level2 - { - /// - private string _level2ObservableProperty = string.Empty; - - /// - private ReactiveUI.ObservableAsPropertyHelper? _level2ObservablePropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public string Level2ObservableProperty { get => _level2ObservableProperty = _level2ObservablePropertyHelper?.Value ?? _level2ObservableProperty; } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - _level2ObservablePropertyHelper = Level2Observable!.ToProperty(this, nameof(Level2ObservableProperty)); - } - } -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInDeeplyNestedClass#TestNs.Level1.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInDeeplyNestedClass#TestNs.Level1.ObservableAsProperties.g.verified.cs deleted file mode 100644 index fbac836b..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInDeeplyNestedClass#TestNs.Level1.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: TestNs.Level1.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - - public partial class Level1 - { - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _level1ValueHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int Level1Value { get => _level1Value = _level1ValueHelper?.Value ?? _level1Value; } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInGenericClass#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInGenericClass#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInGenericClass#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInGenericClass#TestNs.GenericVM`1.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInGenericClass#TestNs.GenericVM`1.ObservableAsProperties.g.verified.cs deleted file mode 100644 index 62f3a14d..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInGenericClass#TestNs.GenericVM`1.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: TestNs.GenericVM`1.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - - public partial class GenericVM - { - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _itemHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public T? Item { get => _item = (_itemHelper == null ? _item : _itemHelper.Value); } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInGenericClass#TestNs.GenericVM`1.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInGenericClass#TestNs.GenericVM`1.ObservableAsPropertyFromObservable.g.verified.cs deleted file mode 100644 index ae88087e..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInGenericClass#TestNs.GenericVM`1.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,31 +0,0 @@ -//HintName: TestNs.GenericVM`1.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - - public partial class GenericVM - { - /// - private T? _itemObservableProperty; - - /// - private ReactiveUI.ObservableAsPropertyHelper? _itemObservablePropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public T? ItemObservableProperty { get => _itemObservableProperty = (_itemObservablePropertyHelper == null ? _itemObservableProperty : _itemObservablePropertyHelper.Value); } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - _itemObservablePropertyHelper = ItemObservable!.ToProperty(this, nameof(ItemObservableProperty)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInRecordClass#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInRecordClass#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInRecordClass#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInRecordClass#TestNs.TestVMRecord.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInRecordClass#TestNs.TestVMRecord.ObservableAsProperties.g.verified.cs deleted file mode 100644 index 8c710372..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInRecordClass#TestNs.TestVMRecord.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: TestNs.TestVMRecord.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - - public partial record TestVMRecord - { - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _statusHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public string? Status { get => _status = (_statusHelper == null ? _status : _statusHelper.Value); } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInRecordClass#TestNs.TestVMRecord.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInRecordClass#TestNs.TestVMRecord.ObservableAsPropertyFromObservable.g.verified.cs deleted file mode 100644 index ba89effb..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldInRecordClass#TestNs.TestVMRecord.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,31 +0,0 @@ -//HintName: TestNs.TestVMRecord.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - - public partial record TestVMRecord - { - /// - private int _countObservableProperty; - - /// - private ReactiveUI.ObservableAsPropertyHelper? _countObservablePropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int CountObservableProperty { get => _countObservableProperty = _countObservablePropertyHelper?.Value ?? _countObservableProperty; } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - _countObservablePropertyHelper = CountObservable!.ToProperty(this, nameof(CountObservableProperty)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithArrayTypes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithArrayTypes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithArrayTypes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithArrayTypes#TestNs.TestVM.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithArrayTypes#TestNs.TestVM.ObservableAsProperties.g.verified.cs deleted file mode 100644 index 540c6128..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithArrayTypes#TestNs.TestVM.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,31 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - - public partial class TestVM - { - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _bytesHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public byte[]? Bytes { get => _bytes = (_bytesHelper == null ? _bytes : _bytesHelper.Value); } - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _stringsHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public string[]? Strings { get => _strings = (_stringsHelper == null ? _strings : _stringsHelper.Value); } - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _jaggedArrayHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int[][]? JaggedArray { get => _jaggedArray = (_jaggedArrayHelper == null ? _jaggedArray : _jaggedArrayHelper.Value); } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithAttributes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithAttributes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithAttributes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithAttributes#TestNs.TestVM.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithAttributes#TestNs.TestVM.ObservableAsProperties.g.verified.cs deleted file mode 100644 index 44e982b6..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithAttributes#TestNs.TestVM.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,22 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - - public partial class TestVM - { - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _computedValueHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.Runtime.Serialization.DataMemberAttribute(Name="computedValue")] - [global::System.Text.Json.Serialization.JsonPropertyNameAttribute("computed_value")] - [global::System.Text.Json.Serialization.JsonIncludeAttribute()] - public int ComputedValue { get => _computedValue = _computedValueHelper?.Value ?? _computedValue; } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithAttributes#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithAttributes#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs deleted file mode 100644 index 69c292fd..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithAttributes#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,34 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - - public partial class TestVM - { - /// - private string _internalStateProperty = string.Empty; - - /// - private ReactiveUI.ObservableAsPropertyHelper? _internalStatePropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.Text.Json.Serialization.JsonIgnoreAttribute()] - [global::System.Runtime.Serialization.IgnoreDataMemberAttribute()] - [global::System.Text.Json.Serialization.JsonIgnoreAttribute()] - public string InternalStateProperty { get => _internalStateProperty = _internalStatePropertyHelper?.Value ?? _internalStateProperty; } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - _internalStatePropertyHelper = InternalState!.ToProperty(this, nameof(InternalStateProperty)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithCombinedOptions#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithCombinedOptions#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithCombinedOptions#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithCombinedOptions#TestNs.TestVM.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithCombinedOptions#TestNs.TestVM.ObservableAsProperties.g.verified.cs deleted file mode 100644 index 7e7eac36..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithCombinedOptions#TestNs.TestVM.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - - public partial class TestVM - { - /// - protected ReactiveUI.ObservableAsPropertyHelper? _statusFieldHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public string StatusField { get => _statusField = _statusFieldHelper?.Value ?? _statusField; } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithDelegateTypes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithDelegateTypes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithDelegateTypes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithDelegateTypes#TestNs.TestVM.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithDelegateTypes#TestNs.TestVM.ObservableAsProperties.g.verified.cs deleted file mode 100644 index 55f1d64f..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithDelegateTypes#TestNs.TestVM.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,31 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - - public partial class TestVM - { - /// - private readonly ReactiveUI.ObservableAsPropertyHelper?> _formatterHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::System.Func? Formatter { get => _formatter = (_formatterHelper == null ? _formatter : _formatterHelper.Value); } - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _callbackHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::System.Action? Callback { get => _callback = (_callbackHelper == null ? _callback : _callbackHelper.Value); } - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _handlerHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::System.EventHandler? Handler { get => _handler = (_handlerHelper == null ? _handler : _handlerHelper.Value); } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithEnumTypes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithEnumTypes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithEnumTypes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithEnumTypes#TestNs.TestVM.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithEnumTypes#TestNs.TestVM.ObservableAsProperties.g.verified.cs deleted file mode 100644 index 6c2569a6..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithEnumTypes#TestNs.TestVM.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - - public partial class TestVM - { - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _statusHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::TestNs.Status Status { get => _status = _statusHelper?.Value ?? _status; } - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _nullableStatusHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::TestNs.Status? NullableStatus { get => _nullableStatus = (_nullableStatusHelper == null ? _nullableStatus : _nullableStatusHelper.Value); } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithGenericTypes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithGenericTypes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithGenericTypes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithGenericTypes#TestNs.TestVM.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithGenericTypes#TestNs.TestVM.ObservableAsProperties.g.verified.cs deleted file mode 100644 index df1ff3c4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithGenericTypes#TestNs.TestVM.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,31 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - - public partial class TestVM - { - /// - private readonly ReactiveUI.ObservableAsPropertyHelper?> _itemsHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::System.Collections.Generic.List? Items { get => _items = (_itemsHelper == null ? _items : _itemsHelper.Value); } - /// - private readonly ReactiveUI.ObservableAsPropertyHelper?> _mappingsHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::System.Collections.Generic.Dictionary? Mappings { get => _mappings = (_mappingsHelper == null ? _mappings : _mappingsHelper.Value); } - /// - private readonly ReactiveUI.ObservableAsPropertyHelper?> _numbersHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::System.Collections.Generic.IReadOnlyList? Numbers { get => _numbers = (_numbersHelper == null ? _numbers : _numbersHelper.Value); } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithInitialValue#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithInitialValue#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithInitialValue#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithInitialValue#TestNs.TestVM.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithInitialValue#TestNs.TestVM.ObservableAsProperties.g.verified.cs deleted file mode 100644 index e80f52f4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithInitialValue#TestNs.TestVM.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - - public partial class TestVM - { - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _statusHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public string Status { get => _status = _statusHelper?.Value ?? _status; } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithInterfaceTypes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithInterfaceTypes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithInterfaceTypes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithInterfaceTypes#TestNs.TestVM.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithInterfaceTypes#TestNs.TestVM.ObservableAsProperties.g.verified.cs deleted file mode 100644 index 6e6accf8..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithInterfaceTypes#TestNs.TestVM.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,31 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - - public partial class TestVM - { - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _currentItemHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::TestNs.IItem? CurrentItem { get => _currentItem = (_currentItemHelper == null ? _currentItem : _currentItemHelper.Value); } - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _subscriptionHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::System.IDisposable? Subscription { get => _subscription = (_subscriptionHelper == null ? _subscription : _subscriptionHelper.Value); } - /// - private readonly ReactiveUI.ObservableAsPropertyHelper?> _allItemsHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::System.Collections.Generic.IReadOnlyCollection? AllItems { get => _allItems = (_allItemsHelper == null ? _allItems : _allItemsHelper.Value); } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithNullableTypes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithNullableTypes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithNullableTypes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithNullableTypes#TestNs.TestVM.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithNullableTypes#TestNs.TestVM.ObservableAsProperties.g.verified.cs deleted file mode 100644 index da9b282e..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithNullableTypes#TestNs.TestVM.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,31 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - - public partial class TestVM - { - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _nullableIntHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int? NullableInt { get => _nullableInt = (_nullableIntHelper == null ? _nullableInt : _nullableIntHelper.Value); } - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _nullableDateTimeHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::System.DateTime? NullableDateTime { get => _nullableDateTime = (_nullableDateTimeHelper == null ? _nullableDateTime : _nullableDateTimeHelper.Value); } - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _nullableGuidHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::System.Guid? NullableGuid { get => _nullableGuid = (_nullableGuidHelper == null ? _nullableGuid : _nullableGuidHelper.Value); } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithNumericInitialValue#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithNumericInitialValue#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithNumericInitialValue#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithNumericInitialValue#TestNs.TestVM.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithNumericInitialValue#TestNs.TestVM.ObservableAsProperties.g.verified.cs deleted file mode 100644 index fb0290ff..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithNumericInitialValue#TestNs.TestVM.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - - public partial class TestVM - { - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _countHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int Count { get => _count = _countHelper?.Value ?? _count; } - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _percentageHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public double Percentage { get => _percentage = _percentageHelper?.Value ?? _percentage; } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithTimeTypes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithTimeTypes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithTimeTypes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithTimeTypes#TestNs.TestVM.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithTimeTypes#TestNs.TestVM.ObservableAsProperties.g.verified.cs deleted file mode 100644 index 46262ff9..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithTimeTypes#TestNs.TestVM.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,31 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - - public partial class TestVM - { - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _elapsedHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::System.TimeSpan Elapsed { get => _elapsed = _elapsedHelper?.Value ?? _elapsed; } - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _lastUpdatedHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::System.DateTimeOffset LastUpdated { get => _lastUpdated = _lastUpdatedHelper?.Value ?? _lastUpdated; } - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _remainingTimeHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::System.TimeSpan? RemainingTime { get => _remainingTime = (_remainingTimeHelper == null ? _remainingTime : _remainingTimeHelper.Value); } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithTupleTypes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithTupleTypes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithTupleTypes#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithTupleTypes#TestNs.TestVM.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithTupleTypes#TestNs.TestVM.ObservableAsProperties.g.verified.cs deleted file mode 100644 index 846130c7..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromFieldWithTupleTypes#TestNs.TestVM.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - - public partial class TestVM - { - /// - private readonly ReactiveUI.ObservableAsPropertyHelper<(int Id, string Name)?> _namedTupleHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public (int Id, string Name)? NamedTuple { get => _namedTuple = (_namedTupleHelper == null ? _namedTuple : _namedTupleHelper.Value); } - /// - private readonly ReactiveUI.ObservableAsPropertyHelper<(string, int, bool)> _valueTupleHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public (string, int, bool) ValueTuple { get => _valueTuple = _valueTupleHelper?.Value ?? _valueTuple; } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromMultipleObservableAsProperties#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromMultipleObservableAsProperties#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromMultipleObservableAsProperties#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromMultipleObservableAsProperties#TestNs.TestVM.ObservableAsProperties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromMultipleObservableAsProperties#TestNs.TestVM.ObservableAsProperties.g.verified.cs deleted file mode 100644 index dafa97cd..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromMultipleObservableAsProperties#TestNs.TestVM.ObservableAsProperties.g.verified.cs +++ /dev/null @@ -1,43 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsProperties.g.cs -// -#pragma warning disable -#nullable enable -namespace TestNs -{ - - public partial class TestVM - { - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _isLoadingHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public bool IsLoading { get => _isLoading = _isLoadingHelper?.Value ?? _isLoading; } - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _errorMessageHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public string? ErrorMessage { get => _errorMessage = (_errorMessageHelper == null ? _errorMessage : _errorMessageHelper.Value); } - /// - private readonly ReactiveUI.ObservableAsPropertyHelper _itemCountHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int ItemCount { get => _itemCount = _itemCountHelper?.Value ?? _itemCount; } - /// - protected readonly ReactiveUI.ObservableAsPropertyHelper _progressHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public double Progress { get => _progress = _progressHelper?.Value ?? _progress; } - /// - private ReactiveUI.ObservableAsPropertyHelper? _statusHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public string Status { get => _status = _statusHelper?.Value ?? _status; } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromMultipleObservableAsProperties#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromMultipleObservableAsProperties#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs deleted file mode 100644 index 56ee1032..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromMultipleObservableAsProperties#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,41 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - - public partial class TestVM - { - /// - private bool _hasItemsProperty; - - /// - private ReactiveUI.ObservableAsPropertyHelper? _hasItemsPropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public bool HasItemsProperty { get => _hasItemsProperty = _hasItemsPropertyHelper?.Value ?? _hasItemsProperty; } -/// - private string _displayNameProperty = string.Empty; - - /// - private ReactiveUI.ObservableAsPropertyHelper? _displayNamePropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public string DisplayNameProperty { get => _displayNameProperty = _displayNamePropertyHelper?.Value ?? _displayNameProperty; } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - _hasItemsPropertyHelper = HasItems!.ToProperty(this, nameof(HasItemsProperty)); - _displayNamePropertyHelper = DisplayName()!.ToProperty(this, nameof(DisplayNameProperty)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservableMethodWithCustomName#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservableMethodWithCustomName#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservableMethodWithCustomName#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservableMethodWithCustomName#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservableMethodWithCustomName#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs deleted file mode 100644 index 33288696..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservableMethodWithCustomName#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,41 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - - public partial class TestVM - { - /// - private bool _isLoading; - - /// - private ReactiveUI.ObservableAsPropertyHelper? _isLoadingHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public bool IsLoading { get => _isLoading = _isLoadingHelper?.Value ?? _isLoading; } -/// - private string? _errorMessage; - - /// - private ReactiveUI.ObservableAsPropertyHelper? _errorMessageHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public string? ErrorMessage { get => _errorMessage = (_errorMessageHelper == null ? _errorMessage : _errorMessageHelper.Value); } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - _isLoadingHelper = GetLoadingState()!.ToProperty(this, nameof(IsLoading)); - _errorMessageHelper = GetError()!.ToProperty(this, nameof(ErrorMessage)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithComplexGenerics#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithComplexGenerics#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithComplexGenerics#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithComplexGenerics#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithComplexGenerics#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs deleted file mode 100644 index 6dbe4e43..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithComplexGenerics#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,41 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - - public partial class TestVM - { - /// - private global::System.Collections.Generic.Dictionary> _complexDataObservableProperty; - - /// - private ReactiveUI.ObservableAsPropertyHelper>>? _complexDataObservablePropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::System.Collections.Generic.Dictionary> ComplexDataObservableProperty { get => _complexDataObservableProperty = _complexDataObservablePropertyHelper?.Value ?? _complexDataObservableProperty; } -/// - private global::System.Collections.Generic.IReadOnlyDictionary> _nestedReadOnlyObservableProperty; - - /// - private ReactiveUI.ObservableAsPropertyHelper>>? _nestedReadOnlyObservablePropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::System.Collections.Generic.IReadOnlyDictionary> NestedReadOnlyObservableProperty { get => _nestedReadOnlyObservableProperty = _nestedReadOnlyObservablePropertyHelper?.Value ?? _nestedReadOnlyObservableProperty; } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - _complexDataObservablePropertyHelper = ComplexDataObservable!.ToProperty(this, nameof(ComplexDataObservableProperty)); - _nestedReadOnlyObservablePropertyHelper = NestedReadOnlyObservable!.ToProperty(this, nameof(NestedReadOnlyObservableProperty)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithEnum#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithEnum#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithEnum#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithEnum#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithEnum#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs deleted file mode 100644 index 557059be..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithEnum#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,31 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - - public partial class TestVM - { - /// - private global::TestNs.ConnectionState _stateObservableProperty; - - /// - private ReactiveUI.ObservableAsPropertyHelper? _stateObservablePropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::TestNs.ConnectionState StateObservableProperty { get => _stateObservableProperty = _stateObservablePropertyHelper?.Value ?? _stateObservableProperty; } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - _stateObservablePropertyHelper = StateObservable!.ToProperty(this, nameof(StateObservableProperty)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithGenericType#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithGenericType#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithGenericType#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithGenericType#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithGenericType#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs deleted file mode 100644 index 9382076e..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithGenericType#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,41 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - - public partial class TestVM - { - /// - private global::System.Collections.Generic.List _itemsObservableProperty; - - /// - private ReactiveUI.ObservableAsPropertyHelper>? _itemsObservablePropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::System.Collections.Generic.List ItemsObservableProperty { get => _itemsObservableProperty = _itemsObservablePropertyHelper?.Value ?? _itemsObservableProperty; } -/// - private global::System.Collections.Generic.IReadOnlyDictionary _mappingsObservableProperty; - - /// - private ReactiveUI.ObservableAsPropertyHelper>? _mappingsObservablePropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::System.Collections.Generic.IReadOnlyDictionary MappingsObservableProperty { get => _mappingsObservableProperty = _mappingsObservablePropertyHelper?.Value ?? _mappingsObservableProperty; } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - _itemsObservablePropertyHelper = ItemsObservable!.ToProperty(this, nameof(ItemsObservableProperty)); - _mappingsObservablePropertyHelper = MappingsObservable!.ToProperty(this, nameof(MappingsObservableProperty)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithInterface#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithInterface#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithInterface#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithInterface#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithInterface#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs deleted file mode 100644 index 7eeacf97..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithInterface#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,31 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - - public partial class TestVM - { - /// - private global::TestNs.IResult? _resultObservableProperty; - - /// - private ReactiveUI.ObservableAsPropertyHelper? _resultObservablePropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::TestNs.IResult? ResultObservableProperty { get => _resultObservableProperty = (_resultObservablePropertyHelper == null ? _resultObservableProperty : _resultObservablePropertyHelper.Value); } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - _resultObservablePropertyHelper = ResultObservable!.ToProperty(this, nameof(ResultObservableProperty)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithTuple#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithTuple#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs deleted file mode 100644 index 05d217a4..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithTuple#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[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 -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the inheritance modifier of the generated property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Gets the Initial Value of the OAPH property. - /// This should be a string representation of the value. i.e. "42" or "DateTime.Now" or "new List<string>()". - /// String values are automatically quoted. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithTuple#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithTuple#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs deleted file mode 100644 index 87410b58..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/OAPH/OapExtTests.FromObservablePropertyWithTuple#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs +++ /dev/null @@ -1,31 +0,0 @@ -//HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - - public partial class TestVM - { - /// - private (bool Success, string Message) _resultObservableProperty; - - /// - private ReactiveUI.ObservableAsPropertyHelper<(bool Success, string Message)>? _resultObservablePropertyHelper; - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public (bool Success, string Message) ResultObservableProperty { get => _resultObservableProperty = _resultObservablePropertyHelper?.Value ?? _resultObservableProperty; } - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - protected void InitializeOAPH() - { - _resultObservablePropertyHelper = ResultObservable!.ToProperty(this, nameof(ResultObservableProperty)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.Basic#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.Basic#AccMod.verified.cs similarity index 85% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.Basic#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.Basic#AccMod.verified.cs index 1ba9e652..f0a955ae 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.Basic#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.Basic#AccMod.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs // Copyright (c) 2026 .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. @@ -46,13 +46,5 @@ internal enum InheritanceModifier Override, New, } - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} #nullable restore #pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.Partial#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.Basic#RxAttr.verified.cs similarity index 96% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.Partial#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.Basic#RxAttr.verified.cs index 8ad05832..1198bf74 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.Partial#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.Basic#RxAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs // Copyright (c) 2026 .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. diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.Basic#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.Basic#TestNs.TestVM.Props.verified.cs similarity index 78% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.Basic#TestNs.TestVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.Basic#TestNs.TestVM.Props.verified.cs index 37a57da2..33529735 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.Basic#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.Basic#TestNs.TestVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.Properties.g.cs +//HintName: TestNs.TestVM.Properties.g.cs // using ReactiveUI; @@ -7,9 +7,8 @@ namespace TestNs { - public partial class TestVM + public partial class TestVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int Test1 @@ -23,4 +22,4 @@ public int Test1 } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.CalledValue#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.CalledValue#AccMod.verified.cs similarity index 85% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.CalledValue#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.CalledValue#AccMod.verified.cs index 1ba9e652..f0a955ae 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.CalledValue#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.CalledValue#AccMod.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs // Copyright (c) 2026 .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. @@ -46,13 +46,5 @@ internal enum InheritanceModifier Override, New, } - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} #nullable restore #pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.PartialAlsoNotify#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.CalledValue#RxAttr.verified.cs similarity index 96% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.PartialAlsoNotify#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.CalledValue#RxAttr.verified.cs index 8ad05832..1198bf74 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.PartialAlsoNotify#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.CalledValue#RxAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs // Copyright (c) 2026 .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. diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.CalledValue#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.CalledValue#TestNs.TestVM.Props.verified.cs similarity index 81% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.CalledValue#TestNs.TestVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.CalledValue#TestNs.TestVM.Props.verified.cs index 3cfe3ae9..7019dcb0 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.CalledValue#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.CalledValue#TestNs.TestVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.Properties.g.cs +//HintName: TestNs.TestVM.Properties.g.cs // using ReactiveUI; @@ -7,9 +7,8 @@ namespace TestNs { - public partial class TestVM + public partial class TestVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public string Value @@ -24,4 +23,4 @@ public string Value } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.Partial#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.Partial#AccMod.verified.cs similarity index 85% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.Partial#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.Partial#AccMod.verified.cs index 1ba9e652..f0a955ae 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.Partial#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.Partial#AccMod.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs // Copyright (c) 2026 .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. @@ -46,13 +46,5 @@ internal enum InheritanceModifier Override, New, } - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} #nullable restore #pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.Basic#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.Partial#RxAttr.verified.cs similarity index 96% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.Basic#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.Partial#RxAttr.verified.cs index 8ad05832..1198bf74 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.Basic#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.Partial#RxAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs // Copyright (c) 2026 .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. diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.PartialAlsoNotify#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.PartialAlsoNotify#AccMod.verified.cs similarity index 85% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.PartialAlsoNotify#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.PartialAlsoNotify#AccMod.verified.cs index 1ba9e652..f0a955ae 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.PartialAlsoNotify#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.PartialAlsoNotify#AccMod.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs // Copyright (c) 2026 .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. @@ -46,13 +46,5 @@ internal enum InheritanceModifier Override, New, } - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} #nullable restore #pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.CalledValue#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.PartialAlsoNotify#RxAttr.verified.cs similarity index 96% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.CalledValue#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.PartialAlsoNotify#RxAttr.verified.cs index 8ad05832..1198bf74 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.CalledValue#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.PartialAlsoNotify#RxAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs // Copyright (c) 2026 .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. diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.PartialAlsoNotify#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.PartialAlsoNotify#TestNs.TestVM.Props.verified.cs similarity index 85% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.PartialAlsoNotify#TestNs.TestVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.PartialAlsoNotify#TestNs.TestVM.Props.verified.cs index 08bcda60..a11cbd93 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.PartialAlsoNotify#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.PartialAlsoNotify#TestNs.TestVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.Properties.g.cs +//HintName: TestNs.TestVM.Properties.g.cs // using ReactiveUI; @@ -7,9 +7,8 @@ namespace TestNs { - public partial class TestVM + public partial class TestVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int Test4 diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAcc#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAcc#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAcc#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAcc#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAcc#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAcc#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAccess#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAcc#TestNs.TestVM.Props.verified.cs similarity index 79% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAccess#TestNs.TestVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAcc#TestNs.TestVM.Props.verified.cs index 879a38c2..7020480a 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAccess#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAcc#TestNs.TestVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.Properties.g.cs +//HintName: TestNs.TestVM.Properties.g.cs // using ReactiveUI; @@ -7,9 +7,8 @@ namespace TestNs { - public partial class TestVM + public partial class TestVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int Test2 @@ -23,4 +22,4 @@ protected set } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAttrAccInherit#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAttrAccInherit#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAttrAccInherit#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAttrAccInherit#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAttrAccInherit#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAttrAccInherit#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAttrAccessInherit#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAttrAccInherit#TestNs.TestVM.Props.verified.cs similarity index 84% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAttrAccessInherit#TestNs.TestVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAttrAccInherit#TestNs.TestVM.Props.verified.cs index f245c5aa..f6e0c555 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAttrAccessInherit#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAttrAccInherit#TestNs.TestVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.Properties.g.cs +//HintName: TestNs.TestVM.Properties.g.cs // using ReactiveUI; @@ -7,15 +7,14 @@ namespace TestNs { - public partial class TestVM + public partial class TestVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] [global::System.Runtime.Serialization.DataMemberAttribute()] [global::System.Text.Json.Serialization.JsonIncludeAttribute()] public virtual string? Name - { + { get => _name; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_name")] protected set @@ -26,4 +25,4 @@ protected set } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAttrs#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAttrs#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAttrs#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAttrs#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAttrs#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAttrs#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAttributes#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAttrs#TestNs.TestVM.Props.verified.cs similarity index 83% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAttributes#TestNs.TestVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAttrs#TestNs.TestVM.Props.verified.cs index 08bad5ca..66003ccc 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAttributes#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WAttrs#TestNs.TestVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.Properties.g.cs +//HintName: TestNs.TestVM.Properties.g.cs // using ReactiveUI; @@ -7,9 +7,8 @@ namespace TestNs { - public partial class TestVM + public partial class TestVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] [global::System.Runtime.Serialization.DataMemberAttribute()] @@ -25,4 +24,4 @@ public int Test3 } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WIdenticalClass#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WIdenticalClass#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WIdenticalClass#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WIdenticalClass#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WIdenticalClass#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WIdenticalClass#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithIdenticalClass#TestNs1.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WIdenticalClass#TestNs1.TestVM.Props.verified.cs similarity index 83% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithIdenticalClass#TestNs1.TestVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WIdenticalClass#TestNs1.TestVM.Props.verified.cs index e98728f0..0c3dbe87 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithIdenticalClass#TestNs1.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WIdenticalClass#TestNs1.TestVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs1.TestVM.Properties.g.cs +//HintName: TestNs1.TestVM.Properties.g.cs // using ReactiveUI; @@ -7,15 +7,14 @@ namespace TestNs1 { - public partial class TestVM + public partial class TestVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] [global::System.Runtime.Serialization.DataMemberAttribute()] [global::System.Text.Json.Serialization.JsonIncludeAttribute()] public virtual string? Name - { + { get => _name; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_name")] protected set @@ -26,4 +25,4 @@ protected set } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithIdenticalClass#TestNs2.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WIdenticalClass#TestNs2.TestVM.Props.verified.cs similarity index 83% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithIdenticalClass#TestNs2.TestVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WIdenticalClass#TestNs2.TestVM.Props.verified.cs index 21637b26..b4f70ee7 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithIdenticalClass#TestNs2.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WIdenticalClass#TestNs2.TestVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs2.TestVM.Properties.g.cs +//HintName: TestNs2.TestVM.Properties.g.cs // using ReactiveUI; @@ -7,15 +7,14 @@ namespace TestNs2 { - public partial class TestVM + public partial class TestVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] [global::System.Runtime.Serialization.DataMemberAttribute()] [global::System.Text.Json.Serialization.JsonIncludeAttribute()] public virtual string? Name - { + { get => _name; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_name")] protected set @@ -26,4 +25,4 @@ protected set } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WInit#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WInit#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WInit#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WInit#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WInit#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WInit#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithInit#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WInit#TestNs.TestVM.Props.verified.cs similarity index 82% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithInit#TestNs.TestVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WInit#TestNs.TestVM.Props.verified.cs index 2f60d617..e9dd9795 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithInit#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WInit#TestNs.TestVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.Properties.g.cs +//HintName: TestNs.TestVM.Properties.g.cs // using ReactiveUI; @@ -7,9 +7,8 @@ namespace TestNs { - public partial class TestVM + public partial class TestVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public required string MustBeSet @@ -24,4 +23,4 @@ public required string MustBeSet } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WNestClass#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WNestClass#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WNestClass#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WNestClass#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WNestClass#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WNestClass#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WNestClass#TestNs1.TestVm3+TestInnerClass1.Props.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WNestClass#TestNs1.TestVm3+TestInnerClass1.Props.verified.cs new file mode 100644 index 00000000..dacde27b --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WNestClass#TestNs1.TestVm3+TestInnerClass1.Props.verified.cs @@ -0,0 +1,39 @@ +//HintName: TestNs1.TestViewModel3+TestInnerClass1.Properties.g.cs +// +using ReactiveUI; + +#pragma warning disable +#nullable enable + +namespace TestNs1 +{ + public partial class TestViewModel3 + { + public partial class TestInnerClass1 + { + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public int TestInner1 + { + get => _testInner1; + set + { + this.RaiseAndSetIfChanged(ref _testInner1, value); + } + } + + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public int TestInner11 + { + get => _testInner11; + set + { + this.RaiseAndSetIfChanged(ref _testInner11, value); + } + } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WNestClass#TestNs1.TestVm3+TestInnerClass2+TestInnerClass3.Props.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WNestClass#TestNs1.TestVm3+TestInnerClass2+TestInnerClass3.Props.verified.cs new file mode 100644 index 00000000..64c5fc0e --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WNestClass#TestNs1.TestVm3+TestInnerClass2+TestInnerClass3.Props.verified.cs @@ -0,0 +1,42 @@ +//HintName: TestNs1.TestViewModel3+TestInnerClass2+TestInnerClass3.Properties.g.cs +// +using ReactiveUI; + +#pragma warning disable +#nullable enable + +namespace TestNs1 +{ + public partial class TestViewModel3 + { + public partial class TestInnerClass2 + { + public partial class TestInnerClass3 + { + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public int TestInner3 + { + get => _testInner3; + set + { + this.RaiseAndSetIfChanged(ref _testInner3, value); + } + } + + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public int TestInner33 + { + get => _testInner33; + set + { + this.RaiseAndSetIfChanged(ref _testInner33, value); + } + } + } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WNestClass#TestNs1.TestVm3+TestInnerClass2.Props.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WNestClass#TestNs1.TestVm3+TestInnerClass2.Props.verified.cs new file mode 100644 index 00000000..d53f2239 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WNestClass#TestNs1.TestVm3+TestInnerClass2.Props.verified.cs @@ -0,0 +1,39 @@ +//HintName: TestNs1.TestViewModel3+TestInnerClass2.Properties.g.cs +// +using ReactiveUI; + +#pragma warning disable +#nullable enable + +namespace TestNs1 +{ + public partial class TestViewModel3 + { + public partial class TestInnerClass2 + { + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public int TestInner2 + { + get => _testInner2; + set + { + this.RaiseAndSetIfChanged(ref _testInner2, value); + } + } + + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public int TestInner22 + { + get => _testInner22; + set + { + this.RaiseAndSetIfChanged(ref _testInner22, value); + } + } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithNestedClass#TestNs1.TestViewModel3.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WNestClass#TestNs1.TestVm3.Props.verified.cs similarity index 85% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithNestedClass#TestNs1.TestViewModel3.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WNestClass#TestNs1.TestVm3.Props.verified.cs index 796ad8b7..8d2621f9 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithNestedClass#TestNs1.TestViewModel3.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RG.WNestClass#TestNs1.TestVm3.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs1.TestViewModel3.Properties.g.cs +//HintName: TestNs1.TestViewModel3.Properties.g.cs // using ReactiveUI; @@ -7,9 +7,8 @@ namespace TestNs1 { - public partial class TestViewModel3 + public partial class TestViewModel3 { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public float TestVM3Property @@ -20,7 +19,7 @@ public float TestVM3Property this.RaiseAndSetIfChanged(ref _testVM3Property, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public float TestVM3Property2 @@ -34,4 +33,4 @@ public float TestVM3Property2 } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Arrays#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Arrays#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Arrays#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Arrays#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Arrays#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Arrays#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Arrays#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Arrays#TestNs.TestVM.Props.verified.cs similarity index 88% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Arrays#TestNs.TestVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Arrays#TestNs.TestVM.Props.verified.cs index 9670978a..20faaf37 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Arrays#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Arrays#TestNs.TestVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.Properties.g.cs +//HintName: TestNs.TestVM.Properties.g.cs // using ReactiveUI; @@ -7,13 +7,12 @@ namespace TestNs { - public partial class TestVM + public partial class TestVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public byte[]? Bytes - { + { get => _bytes; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_bytes")] set @@ -21,11 +20,11 @@ public byte[]? Bytes this.RaiseAndSetIfChanged(ref _bytes, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public string[]? Strings - { + { get => _strings; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_strings")] set @@ -33,11 +32,11 @@ public string[]? Strings this.RaiseAndSetIfChanged(ref _strings, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int[][]? JaggedArray - { + { get => _jaggedArray; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_jaggedArray")] set @@ -48,4 +47,4 @@ public int[][]? JaggedArray } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.CplxGen#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.CplxGen#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.CplxGen#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.CplxGen#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.CplxGen#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.CplxGen#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.ComplexGen#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.CplxGen#TestNs.TestVM.Props.verified.cs similarity index 91% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.ComplexGen#TestNs.TestVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.CplxGen#TestNs.TestVM.Props.verified.cs index b1031499..acbe7862 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.ComplexGen#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.CplxGen#TestNs.TestVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.Properties.g.cs +//HintName: TestNs.TestVM.Properties.g.cs // using ReactiveUI; @@ -7,13 +7,12 @@ namespace TestNs { - public partial class TestVM + public partial class TestVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Collections.Generic.Dictionary>? NestedGenerics - { + { get => _nestedGenerics; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_nestedGenerics")] set @@ -21,11 +20,11 @@ public partial class TestVM this.RaiseAndSetIfChanged(ref _nestedGenerics, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Collections.Generic.IReadOnlyDictionary>? ReadOnlyNestedGenerics - { + { get => _readOnlyNestedGenerics; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_readOnlyNestedGenerics")] set @@ -33,11 +32,11 @@ public partial class TestVM this.RaiseAndSetIfChanged(ref _readOnlyNestedGenerics, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Func>, bool>? ComplexFunc - { + { get => _complexFunc; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_complexFunc")] set @@ -48,4 +47,4 @@ public partial class TestVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.DeepNest#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.DeepNest#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.DeepNest#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.DeepNest#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.DeepNest#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.DeepNest#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.DeepNest#TestNs.Level1+Level2+Level3+Level4+Level5.Props.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.DeepNest#TestNs.Level1+Level2+Level3+Level4+Level5.Props.verified.cs new file mode 100644 index 00000000..ee6b696c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.DeepNest#TestNs.Level1+Level2+Level3+Level4+Level5.Props.verified.cs @@ -0,0 +1,37 @@ +//HintName: TestNs.Level1+Level2+Level3+Level4+Level5.Properties.g.cs +// +using ReactiveUI; + +#pragma warning disable +#nullable enable + +namespace TestNs +{ + public partial class Level1 + { + public partial class Level2 + { + public partial class Level3 + { + public partial class Level4 + { + public partial class Level5 + { + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public int Level5Prop + { + get => _level5Prop; + set + { + this.RaiseAndSetIfChanged(ref _level5Prop, value); + } + } + } + } + } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.DeepNest#TestNs.Level1+Level2+Level3+Level4.Props.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.DeepNest#TestNs.Level1+Level2+Level3+Level4.Props.verified.cs new file mode 100644 index 00000000..5bfd08c2 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.DeepNest#TestNs.Level1+Level2+Level3+Level4.Props.verified.cs @@ -0,0 +1,34 @@ +//HintName: TestNs.Level1+Level2+Level3+Level4.Properties.g.cs +// +using ReactiveUI; + +#pragma warning disable +#nullable enable + +namespace TestNs +{ + public partial class Level1 + { + public partial class Level2 + { + public partial class Level3 + { + public partial class Level4 + { + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public int Level4Prop + { + get => _level4Prop; + set + { + this.RaiseAndSetIfChanged(ref _level4Prop, value); + } + } + } + } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.DeepNest#TestNs.Level1+Level2+Level3.Props.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.DeepNest#TestNs.Level1+Level2+Level3.Props.verified.cs new file mode 100644 index 00000000..c907d361 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.DeepNest#TestNs.Level1+Level2+Level3.Props.verified.cs @@ -0,0 +1,31 @@ +//HintName: TestNs.Level1+Level2+Level3.Properties.g.cs +// +using ReactiveUI; + +#pragma warning disable +#nullable enable + +namespace TestNs +{ + public partial class Level1 + { + public partial class Level2 + { + public partial class Level3 + { + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public int Level3Prop + { + get => _level3Prop; + set + { + this.RaiseAndSetIfChanged(ref _level3Prop, value); + } + } + } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.DeepNest#TestNs.Level1+Level2.Props.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.DeepNest#TestNs.Level1+Level2.Props.verified.cs new file mode 100644 index 00000000..3b24adf6 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.DeepNest#TestNs.Level1+Level2.Props.verified.cs @@ -0,0 +1,28 @@ +//HintName: TestNs.Level1+Level2.Properties.g.cs +// +using ReactiveUI; + +#pragma warning disable +#nullable enable + +namespace TestNs +{ + public partial class Level1 + { + public partial class Level2 + { + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public int Level2Prop + { + get => _level2Prop; + set + { + this.RaiseAndSetIfChanged(ref _level2Prop, value); + } + } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.DeepNested#TestNs.Level1.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.DeepNest#TestNs.Level1.Props.verified.cs similarity index 79% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.DeepNested#TestNs.Level1.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.DeepNest#TestNs.Level1.Props.verified.cs index 3a658eaf..1f906bca 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.DeepNested#TestNs.Level1.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.DeepNest#TestNs.Level1.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.Level1.Properties.g.cs +//HintName: TestNs.Level1.Properties.g.cs // using ReactiveUI; @@ -7,9 +7,8 @@ namespace TestNs { - public partial class Level1 + public partial class Level1 { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int Level1Prop @@ -23,4 +22,4 @@ public int Level1Prop } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Delegates#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Delegates#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Delegates#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Delegates#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Delegates#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Delegates#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Delegates#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Delegates#TestNs.TestVM.Props.verified.cs similarity index 88% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Delegates#TestNs.TestVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Delegates#TestNs.TestVM.Props.verified.cs index 7bd0d773..af08b0ce 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Delegates#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Delegates#TestNs.TestVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.Properties.g.cs +//HintName: TestNs.TestVM.Properties.g.cs // using ReactiveUI; @@ -7,13 +7,12 @@ namespace TestNs { - public partial class TestVM + public partial class TestVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Action? Action - { + { get => _action; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_action")] set @@ -21,11 +20,11 @@ public partial class TestVM this.RaiseAndSetIfChanged(ref _action, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Func? Func - { + { get => _func; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_func")] set @@ -33,11 +32,11 @@ public partial class TestVM this.RaiseAndSetIfChanged(ref _func, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.EventHandler? Handler - { + { get => _handler; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_handler")] set @@ -48,4 +47,4 @@ public partial class TestVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Enums#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Enums#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Enums#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Enums#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Enums#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Enums#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Enums#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Enums#TestNs.TestVM.Props.verified.cs similarity index 89% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Enums#TestNs.TestVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Enums#TestNs.TestVM.Props.verified.cs index 0836b98c..16633b56 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Enums#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Enums#TestNs.TestVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.Properties.g.cs +//HintName: TestNs.TestVM.Properties.g.cs // using ReactiveUI; @@ -7,9 +7,8 @@ namespace TestNs { - public partial class TestVM + public partial class TestVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::TestNs.Status Status @@ -20,7 +19,7 @@ public partial class TestVM this.RaiseAndSetIfChanged(ref _status, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::TestNs.Status? NullableStatus @@ -31,7 +30,7 @@ public partial class TestVM this.RaiseAndSetIfChanged(ref _nullableStatus, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::TestNs.Permissions Permissions @@ -45,4 +44,4 @@ public partial class TestVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Gen#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Gen#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Gen#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Gen#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Gen#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Gen#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Generic#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Gen#TestNs.TestVM.Props.verified.cs similarity index 89% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Generic#TestNs.TestVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Gen#TestNs.TestVM.Props.verified.cs index 1ee48c6e..8ea7e08d 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Generic#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Gen#TestNs.TestVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.Properties.g.cs +//HintName: TestNs.TestVM.Properties.g.cs // using ReactiveUI; @@ -7,13 +7,12 @@ namespace TestNs { - public partial class TestVM + public partial class TestVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Collections.Generic.List? Items - { + { get => _items; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_items")] set @@ -21,11 +20,11 @@ public partial class TestVM this.RaiseAndSetIfChanged(ref _items, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Collections.Generic.Dictionary? Mappings - { + { get => _mappings; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_mappings")] set @@ -33,11 +32,11 @@ public partial class TestVM this.RaiseAndSetIfChanged(ref _mappings, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Collections.Generic.IEnumerable? Numbers - { + { get => _numbers; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_numbers")] set @@ -48,4 +47,4 @@ public partial class TestVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.GenClass#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.GenClass#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.GenClass#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.GenClass#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.GenClass#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.GenClass#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.GenClass#TestNs.GenericVM`1.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.GenClass#TestNs.GenVM`1.Props.verified.cs similarity index 84% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.GenClass#TestNs.GenericVM`1.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.GenClass#TestNs.GenVM`1.Props.verified.cs index 5f998cc5..951c8af1 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.GenClass#TestNs.GenericVM`1.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.GenClass#TestNs.GenVM`1.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.GenericVM`1.Properties.g.cs +//HintName: TestNs.GenericVM`1.Properties.g.cs // using ReactiveUI; @@ -7,13 +7,12 @@ namespace TestNs { - public partial class GenericVM + public partial class GenericVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public T? Item - { + { get => _item; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_item")] set @@ -21,7 +20,7 @@ public T? Item this.RaiseAndSetIfChanged(ref _item, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int Count @@ -35,4 +34,4 @@ public int Count } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.GenClass#TestNs.GenericVM`2.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.GenClass#TestNs.GenVM`2.Props.verified.cs similarity index 83% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.GenClass#TestNs.GenericVM`2.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.GenClass#TestNs.GenVM`2.Props.verified.cs index 632aceed..3b89f316 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.GenClass#TestNs.GenericVM`2.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.GenClass#TestNs.GenVM`2.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.GenericVM`2.Properties.g.cs +//HintName: TestNs.GenericVM`2.Properties.g.cs // using ReactiveUI; @@ -7,13 +7,12 @@ namespace TestNs { - public partial class GenericVM + public partial class GenericVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public TKey? Key - { + { get => _key; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_key")] set @@ -21,11 +20,11 @@ public TKey? Key this.RaiseAndSetIfChanged(ref _key, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public TValue? Value - { + { get => _value; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_value")] set @@ -36,4 +35,4 @@ public TValue? Value } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Interfaces#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Interfaces#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Interfaces#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Interfaces#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Interfaces#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Interfaces#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Interfaces#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Interfaces#TestNs.TestVM.Props.verified.cs similarity index 88% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Interfaces#TestNs.TestVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Interfaces#TestNs.TestVM.Props.verified.cs index a4885aed..d24f5252 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Interfaces#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Interfaces#TestNs.TestVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.Properties.g.cs +//HintName: TestNs.TestVM.Properties.g.cs // using ReactiveUI; @@ -7,13 +7,12 @@ namespace TestNs { - public partial class TestVM + public partial class TestVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::TestNs.IItem? Item - { + { get => _item; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_item")] set @@ -21,11 +20,11 @@ public partial class TestVM this.RaiseAndSetIfChanged(ref _item, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.IDisposable? Disposable - { + { get => _disposable; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_disposable")] set @@ -33,11 +32,11 @@ public partial class TestVM this.RaiseAndSetIfChanged(ref _disposable, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Collections.Generic.IList? List - { + { get => _list; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_list")] set @@ -48,4 +47,4 @@ public partial class TestVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Lazy#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Lazy#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Lazy#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Lazy#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Lazy#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Lazy#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Lazy#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Lazy#TestNs.TestVM.Props.verified.cs similarity index 86% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Lazy#TestNs.TestVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Lazy#TestNs.TestVM.Props.verified.cs index 14ec21ae..4ef3395d 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Lazy#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Lazy#TestNs.TestVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.Properties.g.cs +//HintName: TestNs.TestVM.Properties.g.cs // using ReactiveUI; @@ -7,13 +7,12 @@ namespace TestNs { - public partial class TestVM + public partial class TestVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Lazy? LazyString - { + { get => _lazyString; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_lazyString")] set @@ -21,11 +20,11 @@ public partial class TestVM this.RaiseAndSetIfChanged(ref _lazyString, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Lazy? LazyInt - { + { get => _lazyInt; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_lazyInt")] set @@ -36,4 +35,4 @@ public partial class TestVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MixedAcc#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MixedAcc#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MixedAcc#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MixedAcc#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MixedAcc#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MixedAcc#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MixedAccess#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MixedAcc#TestNs.TestVM.Props.verified.cs similarity index 92% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MixedAccess#TestNs.TestVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MixedAcc#TestNs.TestVM.Props.verified.cs index 7b7f6496..c85254c5 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MixedAccess#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MixedAcc#TestNs.TestVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.Properties.g.cs +//HintName: TestNs.TestVM.Properties.g.cs // using ReactiveUI; @@ -7,13 +7,12 @@ namespace TestNs { - public partial class TestVM + public partial class TestVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public string? PublicSet - { + { get => _publicSet; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_publicSet")] set @@ -21,11 +20,11 @@ public string? PublicSet this.RaiseAndSetIfChanged(ref _publicSet, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public string? ProtectedSet - { + { get => _protectedSet; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_protectedSet")] protected set @@ -33,11 +32,11 @@ protected set this.RaiseAndSetIfChanged(ref _protectedSet, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public string? InternalSet - { + { get => _internalSet; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_internalSet")] internal set @@ -45,11 +44,11 @@ internal set this.RaiseAndSetIfChanged(ref _internalSet, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public string? PrivateSet - { + { get => _privateSet; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_privateSet")] private set @@ -57,11 +56,11 @@ private set this.RaiseAndSetIfChanged(ref _privateSet, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public string? InternalProtectedSet - { + { get => _internalProtectedSet; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_internalProtectedSet")] protected internal set @@ -69,11 +68,11 @@ protected internal set this.RaiseAndSetIfChanged(ref _internalProtectedSet, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public string? PrivateProtectedSet - { + { get => _privateProtectedSet; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_privateProtectedSet")] private protected set @@ -84,4 +83,4 @@ private protected set } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiAlso#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiAlso#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiAlso#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiAlso#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiAlso#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiAlso#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiAlso#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiAlso#TestNs.TestVM.Props.verified.cs similarity index 90% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiAlso#TestNs.TestVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiAlso#TestNs.TestVM.Props.verified.cs index c3bb08ee..3151b859 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiAlso#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiAlso#TestNs.TestVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.Properties.g.cs +//HintName: TestNs.TestVM.Properties.g.cs // using ReactiveUI; @@ -7,13 +7,12 @@ namespace TestNs { - public partial class TestVM + public partial class TestVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public string? FirstName - { + { get => _firstName; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_firstName")] set @@ -23,11 +22,11 @@ public string? FirstName this.RaisePropertyChanged(nameof(DisplayName)); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public string? LastName - { + { get => _lastName; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_lastName")] set diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiAttr#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiAttr#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiAttr#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiAttr#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiAttr#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiAttr#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiAttr#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiAttr#TestNs.TestVM.Props.verified.cs similarity index 89% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiAttr#TestNs.TestVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiAttr#TestNs.TestVM.Props.verified.cs index e64a89c4..b47d5685 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiAttr#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiAttr#TestNs.TestVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.Properties.g.cs +//HintName: TestNs.TestVM.Properties.g.cs // using ReactiveUI; @@ -7,16 +7,15 @@ namespace TestNs { - public partial class TestVM + public partial class TestVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] [global::System.Runtime.Serialization.DataMemberAttribute(Name="userName")] [global::System.Text.Json.Serialization.JsonIncludeAttribute()] [global::System.Text.Json.Serialization.JsonPropertyNameAttribute("user_name")] public string? UserName - { + { get => _userName; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_userName")] set @@ -24,13 +23,13 @@ public string? UserName this.RaiseAndSetIfChanged(ref _userName, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] [global::System.Runtime.Serialization.IgnoreDataMemberAttribute()] [global::System.Text.Json.Serialization.JsonIgnoreAttribute()] public string? Password - { + { get => _password; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_password")] set @@ -41,4 +40,4 @@ public string? Password } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiPartial#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiPartial#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiPartial#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiPartial#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiPartial#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiPartial#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiPartial#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiPartial#TestNs.TestVM.Props.verified.cs similarity index 88% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiPartial#TestNs.TestVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiPartial#TestNs.TestVM.Props.verified.cs index 6df2a26c..7d648d7d 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiPartial#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.MultiPartial#TestNs.TestVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.Properties.g.cs +//HintName: TestNs.TestVM.Properties.g.cs // using ReactiveUI; @@ -7,13 +7,12 @@ namespace TestNs { - public partial class TestVM + public partial class TestVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public string? FirstName - { + { get => _firstName; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_firstName")] set @@ -21,11 +20,11 @@ public string? FirstName this.RaiseAndSetIfChanged(ref _firstName, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public string? LastName - { + { get => _lastName; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_lastName")] set @@ -33,7 +32,7 @@ public string? LastName this.RaiseAndSetIfChanged(ref _lastName, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int Age @@ -47,4 +46,4 @@ public int Age } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.NewMod#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.NewMod#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.NewMod#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.NewMod#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.NewMod#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.NewMod#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.NewMod#TestNs.BaseVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.NewMod#TestNs.BaseVM.Props.verified.cs similarity index 81% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.NewMod#TestNs.BaseVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.NewMod#TestNs.BaseVM.Props.verified.cs index 586b18ce..5d453fb2 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.NewMod#TestNs.BaseVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.NewMod#TestNs.BaseVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.BaseVM.Properties.g.cs +//HintName: TestNs.BaseVM.Properties.g.cs // using ReactiveUI; @@ -7,13 +7,12 @@ namespace TestNs { - public partial class BaseVM + public partial class BaseVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public string? ShadowedProp - { + { get => _shadowedProp; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_shadowedProp")] set @@ -24,4 +23,4 @@ public string? ShadowedProp } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.NewMod#TestNs.DerivedVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.NewMod#TestNs.DerivedVM.Props.verified.cs similarity index 80% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.NewMod#TestNs.DerivedVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.NewMod#TestNs.DerivedVM.Props.verified.cs index 0203a84f..7ddab434 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.NewMod#TestNs.DerivedVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.NewMod#TestNs.DerivedVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.DerivedVM.Properties.g.cs +//HintName: TestNs.DerivedVM.Properties.g.cs // using ReactiveUI; @@ -7,13 +7,12 @@ namespace TestNs { - public partial class DerivedVM + public partial class DerivedVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public new string? ShadowedProp - { + { get => _shadowedProp; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_shadowedProp")] set @@ -24,4 +23,4 @@ public partial class DerivedVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Null#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Null#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Null#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Null#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Null#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Null#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Nullable#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Null#TestNs.TestVM.Props.verified.cs similarity index 91% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Nullable#TestNs.TestVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Null#TestNs.TestVM.Props.verified.cs index 3b367fdf..169b46c4 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Nullable#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Null#TestNs.TestVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.Properties.g.cs +//HintName: TestNs.TestVM.Properties.g.cs // using ReactiveUI; @@ -7,9 +7,8 @@ namespace TestNs { - public partial class TestVM + public partial class TestVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int? NullableInt @@ -20,7 +19,7 @@ public int? NullableInt this.RaiseAndSetIfChanged(ref _nullableInt, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.DateTime? NullableDateTime @@ -31,7 +30,7 @@ public int? NullableInt this.RaiseAndSetIfChanged(ref _nullableDateTime, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Guid? NullableGuid @@ -42,7 +41,7 @@ public int? NullableInt this.RaiseAndSetIfChanged(ref _nullableGuid, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public decimal? NullableDecimal @@ -56,4 +55,4 @@ public decimal? NullableDecimal } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Override#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Override#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Override#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Override#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Override#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Override#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Override#TestNs.BaseVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Override#TestNs.BaseVM.Props.verified.cs similarity index 80% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Override#TestNs.BaseVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Override#TestNs.BaseVM.Props.verified.cs index e00794ce..cf4304b7 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Override#TestNs.BaseVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Override#TestNs.BaseVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.BaseVM.Properties.g.cs +//HintName: TestNs.BaseVM.Properties.g.cs // using ReactiveUI; @@ -7,13 +7,12 @@ namespace TestNs { - public partial class BaseVM + public partial class BaseVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public virtual string? BaseName - { + { get => _baseName; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_baseName")] set @@ -24,4 +23,4 @@ public virtual string? BaseName } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Override#TestNs.DerivedVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Override#TestNs.DerivedVM.Props.verified.cs similarity index 80% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Override#TestNs.DerivedVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Override#TestNs.DerivedVM.Props.verified.cs index ae72ca05..e70f9501 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Override#TestNs.DerivedVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Override#TestNs.DerivedVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.DerivedVM.Properties.g.cs +//HintName: TestNs.DerivedVM.Properties.g.cs // using ReactiveUI; @@ -7,13 +7,12 @@ namespace TestNs { - public partial class DerivedVM + public partial class DerivedVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public override string? BaseName - { + { get => _baseName; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_baseName")] set @@ -24,4 +23,4 @@ public override string? BaseName } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Record#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Record#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Record#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Record#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Record#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Record#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Record#TestNs.TestVMRecord.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Record#TestNs.TestVMRecord.Props.verified.cs similarity index 84% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Record#TestNs.TestVMRecord.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Record#TestNs.TestVMRecord.Props.verified.cs index 60bc9612..ebe73c73 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Record#TestNs.TestVMRecord.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Record#TestNs.TestVMRecord.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVMRecord.Properties.g.cs +//HintName: TestNs.TestVMRecord.Properties.g.cs // using ReactiveUI; @@ -7,13 +7,12 @@ namespace TestNs { - public partial record TestVMRecord + public partial record TestVMRecord { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public string? Name - { + { get => _name; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_name")] set @@ -21,7 +20,7 @@ public string? Name this.RaiseAndSetIfChanged(ref _name, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public int Age @@ -35,4 +34,4 @@ public int Age } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Ro#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Ro#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Ro#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Ro#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Ro#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Ro#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.ReadOnly#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Ro#TestNs.TestVM.Props.verified.cs similarity index 86% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.ReadOnly#TestNs.TestVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Ro#TestNs.TestVM.Props.verified.cs index 1f0b57aa..8f43df99 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.ReadOnly#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Ro#TestNs.TestVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.Properties.g.cs +//HintName: TestNs.TestVM.Properties.g.cs // using ReactiveUI; @@ -7,9 +7,8 @@ namespace TestNs { - public partial class TestVM + public partial class TestVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::TestNs.ImmutablePoint Point @@ -20,7 +19,7 @@ public partial class TestVM this.RaiseAndSetIfChanged(ref _point, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::TestNs.ImmutablePoint? OptionalPoint @@ -34,4 +33,4 @@ public partial class TestVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Struct#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Struct#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Struct#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Struct#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Struct#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Struct#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Struct#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Struct#TestNs.TestVM.Props.verified.cs similarity index 86% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Struct#TestNs.TestVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Struct#TestNs.TestVM.Props.verified.cs index 5825ffbd..0a7cec08 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Struct#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Struct#TestNs.TestVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.Properties.g.cs +//HintName: TestNs.TestVM.Properties.g.cs // using ReactiveUI; @@ -7,9 +7,8 @@ namespace TestNs { - public partial class TestVM + public partial class TestVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::TestNs.Point Location @@ -20,7 +19,7 @@ public partial class TestVM this.RaiseAndSetIfChanged(ref _location, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::TestNs.Point? OptionalLocation @@ -34,4 +33,4 @@ public partial class TestVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Time#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Time#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Time#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Time#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Time#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Time#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Time#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Time#TestNs.TestVM.Props.verified.cs similarity index 93% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Time#TestNs.TestVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Time#TestNs.TestVM.Props.verified.cs index a7da656c..ef2b7ef8 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Time#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Time#TestNs.TestVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.Properties.g.cs +//HintName: TestNs.TestVM.Properties.g.cs // using ReactiveUI; @@ -7,9 +7,8 @@ namespace TestNs { - public partial class TestVM + public partial class TestVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.TimeSpan Duration @@ -20,7 +19,7 @@ public partial class TestVM this.RaiseAndSetIfChanged(ref _duration, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.TimeSpan? OptionalDuration @@ -31,7 +30,7 @@ public partial class TestVM this.RaiseAndSetIfChanged(ref _optionalDuration, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.DateTimeOffset Timestamp @@ -42,7 +41,7 @@ public partial class TestVM this.RaiseAndSetIfChanged(ref _timestamp, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.DateTimeOffset? OptionalTimestamp @@ -53,7 +52,7 @@ public partial class TestVM this.RaiseAndSetIfChanged(ref _optionalTimestamp, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.TimeOnly TimeOnly @@ -64,7 +63,7 @@ public partial class TestVM this.RaiseAndSetIfChanged(ref _timeOnly, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.DateOnly DateOnly @@ -78,4 +77,4 @@ public partial class TestVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Tuples#AccMod.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Tuples#AccMod.verified.cs new file mode 100644 index 00000000..f0a955ae --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Tuples#AccMod.verified.cs @@ -0,0 +1,50 @@ +//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs +// Copyright (c) 2026 .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; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Tuples#RxAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Tuples#RxAttr.verified.cs new file mode 100644 index 00000000..1198bf74 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Tuples#RxAttr.verified.cs @@ -0,0 +1,51 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Tuples#TestNs.TestVM.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Tuples#TestNs.TestVM.Props.verified.cs similarity index 89% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Tuples#TestNs.TestVM.Properties.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Tuples#TestNs.TestVM.Props.verified.cs index 356dd00c..bbd18eaa 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Tuples#TestNs.TestVM.Properties.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RGE.Tuples#TestNs.TestVM.Props.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.Properties.g.cs +//HintName: TestNs.TestVM.Properties.g.cs // using ReactiveUI; @@ -7,9 +7,8 @@ namespace TestNs { - public partial class TestVM + public partial class TestVM { - /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public (int Id, string Name)? NamedTuple @@ -20,11 +19,11 @@ public partial class TestVM this.RaiseAndSetIfChanged(ref _namedTuple, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Tuple? Tuple - { + { get => _tuple; [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_tuple")] set @@ -32,7 +31,7 @@ public partial class TestVM this.RaiseAndSetIfChanged(ref _tuple, value); } } - + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public (string, int, bool) ValueTuple @@ -46,4 +45,4 @@ public partial class TestVM } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAccess#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAccess#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAccess#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAccess#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAccess#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAccess#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAttrAccessInherit#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAttrAccessInherit#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAttrAccessInherit#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAttrAccessInherit#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAttrAccessInherit#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAttrAccessInherit#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAttributes#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAttributes#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAttributes#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAttributes#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAttributes#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithAttributes#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithIdenticalClass#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithIdenticalClass#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithIdenticalClass#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithIdenticalClass#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithIdenticalClass#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithIdenticalClass#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithInit#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithInit#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithInit#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithInit#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithInit#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithInit#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithNestedClass#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithNestedClass#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithNestedClass#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithNestedClass#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithNestedClass#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithNestedClass#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithNestedClass#TestNs1.TestViewModel3+TestInnerClass1.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithNestedClass#TestNs1.TestViewModel3+TestInnerClass1.Properties.g.verified.cs deleted file mode 100644 index f5625319..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithNestedClass#TestNs1.TestViewModel3+TestInnerClass1.Properties.g.verified.cs +++ /dev/null @@ -1,41 +0,0 @@ -//HintName: TestNs1.TestViewModel3+TestInnerClass1.Properties.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs1 -{ - public partial class TestViewModel3 -{ - public partial class TestInnerClass1 - { - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int TestInner1 - { - get => _testInner1; - set - { - this.RaiseAndSetIfChanged(ref _testInner1, value); - } - } - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int TestInner11 - { - get => _testInner11; - set - { - this.RaiseAndSetIfChanged(ref _testInner11, value); - } - } - } -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithNestedClass#TestNs1.TestViewModel3+TestInnerClass2+TestInnerClass3.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithNestedClass#TestNs1.TestViewModel3+TestInnerClass2+TestInnerClass3.Properties.g.verified.cs deleted file mode 100644 index 2c39569a..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithNestedClass#TestNs1.TestViewModel3+TestInnerClass2+TestInnerClass3.Properties.g.verified.cs +++ /dev/null @@ -1,44 +0,0 @@ -//HintName: TestNs1.TestViewModel3+TestInnerClass2+TestInnerClass3.Properties.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs1 -{ - public partial class TestViewModel3 -{ -public partial class TestInnerClass2 -{ - public partial class TestInnerClass3 - { - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int TestInner3 - { - get => _testInner3; - set - { - this.RaiseAndSetIfChanged(ref _testInner3, value); - } - } - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int TestInner33 - { - get => _testInner33; - set - { - this.RaiseAndSetIfChanged(ref _testInner33, value); - } - } - } -} -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithNestedClass#TestNs1.TestViewModel3+TestInnerClass2.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithNestedClass#TestNs1.TestViewModel3+TestInnerClass2.Properties.g.verified.cs deleted file mode 100644 index 476fef6a..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.WithNestedClass#TestNs1.TestViewModel3+TestInnerClass2.Properties.g.verified.cs +++ /dev/null @@ -1,41 +0,0 @@ -//HintName: TestNs1.TestViewModel3+TestInnerClass2.Properties.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs1 -{ - public partial class TestViewModel3 -{ - public partial class TestInnerClass2 - { - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int TestInner2 - { - get => _testInner2; - set - { - this.RaiseAndSetIfChanged(ref _testInner2, value); - } - } - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int TestInner22 - { - get => _testInner22; - set - { - this.RaiseAndSetIfChanged(ref _testInner22, value); - } - } - } -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Arrays#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Arrays#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Arrays#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Arrays#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Arrays#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Arrays#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.ComplexGen#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.ComplexGen#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.ComplexGen#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.ComplexGen#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.ComplexGen#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.ComplexGen#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.DeepNested#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.DeepNested#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.DeepNested#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.DeepNested#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.DeepNested#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.DeepNested#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.DeepNested#TestNs.Level1+Level2+Level3+Level4+Level5.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.DeepNested#TestNs.Level1+Level2+Level3+Level4+Level5.Properties.g.verified.cs deleted file mode 100644 index 9e2acfd0..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.DeepNested#TestNs.Level1+Level2+Level3+Level4+Level5.Properties.g.verified.cs +++ /dev/null @@ -1,39 +0,0 @@ -//HintName: TestNs.Level1+Level2+Level3+Level4+Level5.Properties.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - public partial class Level1 -{ -public partial class Level2 -{ -public partial class Level3 -{ -public partial class Level4 -{ - public partial class Level5 - { - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int Level5Prop - { - get => _level5Prop; - set - { - this.RaiseAndSetIfChanged(ref _level5Prop, value); - } - } - } -} -} -} -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.DeepNested#TestNs.Level1+Level2+Level3+Level4.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.DeepNested#TestNs.Level1+Level2+Level3+Level4.Properties.g.verified.cs deleted file mode 100644 index 3225bd06..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.DeepNested#TestNs.Level1+Level2+Level3+Level4.Properties.g.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//HintName: TestNs.Level1+Level2+Level3+Level4.Properties.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - public partial class Level1 -{ -public partial class Level2 -{ -public partial class Level3 -{ - public partial class Level4 - { - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int Level4Prop - { - get => _level4Prop; - set - { - this.RaiseAndSetIfChanged(ref _level4Prop, value); - } - } - } -} -} -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.DeepNested#TestNs.Level1+Level2+Level3.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.DeepNested#TestNs.Level1+Level2+Level3.Properties.g.verified.cs deleted file mode 100644 index 7c55edd6..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.DeepNested#TestNs.Level1+Level2+Level3.Properties.g.verified.cs +++ /dev/null @@ -1,33 +0,0 @@ -//HintName: TestNs.Level1+Level2+Level3.Properties.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - public partial class Level1 -{ -public partial class Level2 -{ - public partial class Level3 - { - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int Level3Prop - { - get => _level3Prop; - set - { - this.RaiseAndSetIfChanged(ref _level3Prop, value); - } - } - } -} -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.DeepNested#TestNs.Level1+Level2.Properties.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.DeepNested#TestNs.Level1+Level2.Properties.g.verified.cs deleted file mode 100644 index ff0fa217..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.DeepNested#TestNs.Level1+Level2.Properties.g.verified.cs +++ /dev/null @@ -1,30 +0,0 @@ -//HintName: TestNs.Level1+Level2.Properties.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - public partial class Level1 -{ - public partial class Level2 - { - - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public int Level2Prop - { - get => _level2Prop; - set - { - this.RaiseAndSetIfChanged(ref _level2Prop, value); - } - } - } -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Delegates#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Delegates#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Delegates#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Delegates#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Delegates#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Delegates#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Enums#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Enums#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Enums#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Enums#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Enums#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Enums#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.GenClass#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.GenClass#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.GenClass#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.GenClass#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.GenClass#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.GenClass#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Generic#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Generic#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Generic#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Generic#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Generic#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Generic#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Interfaces#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Interfaces#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Interfaces#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Interfaces#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Interfaces#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Interfaces#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Lazy#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Lazy#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Lazy#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Lazy#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Lazy#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Lazy#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MixedAccess#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MixedAccess#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MixedAccess#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MixedAccess#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MixedAccess#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MixedAccess#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiAlso#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiAlso#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiAlso#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiAlso#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiAlso#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiAlso#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiAttr#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiAttr#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiAttr#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiAttr#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiAttr#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiAttr#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiPartial#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiPartial#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiPartial#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiPartial#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiPartial#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.MultiPartial#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.NewMod#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.NewMod#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.NewMod#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.NewMod#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.NewMod#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.NewMod#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Nullable#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Nullable#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Nullable#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Nullable#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Nullable#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Nullable#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Override#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Override#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Override#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Override#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Override#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Override#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.ReadOnly#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.ReadOnly#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.ReadOnly#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.ReadOnly#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.ReadOnly#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.ReadOnly#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Record#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Record#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Record#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Record#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Record#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Record#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Struct#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Struct#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Struct#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Struct#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Struct#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Struct#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Time#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Time#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Time#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Time#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Time#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Time#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Tuples#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Tuples#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs deleted file mode 100644 index 1ba9e652..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Tuples#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs -// Copyright (c) 2026 .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; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Tuples#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Tuples#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs deleted file mode 100644 index 8ad05832..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVE/RxGenExtTests.Tuples#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs -// Copyright (c) 2026 .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 ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Access#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FMultiRxCmds#RxCmdAttr.verified.cs similarity index 95% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Access#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FMultiRxCmds#RxCmdAttr.verified.cs index b0534866..0f45d48c 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Access#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FMultiRxCmds#RxCmdAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs // Copyright (c) 2026 .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. diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromMultipleReactiveCommands#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FMultiRxCmds#TestNs.TestVM.RxCmds.verified.cs similarity index 98% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromMultipleReactiveCommands#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FMultiRxCmds#TestNs.TestVM.RxCmds.verified.cs index c8c0ea6a..4d8c1f6e 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromMultipleReactiveCommands#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FMultiRxCmds#TestNs.TestVM.RxCmds.verified.cs @@ -6,30 +6,28 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand? _createCommand; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand CreateCommand { get => _createCommand ??= global::ReactiveUI.ReactiveCommand.Create(Create); } - private global::ReactiveUI.ReactiveCommand? _saveCommand; + private global::ReactiveUI.ReactiveCommand? _saveCommand; [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand SaveCommand { get => _saveCommand ??= global::ReactiveUI.ReactiveCommand.CreateFromTask(Save, CanExecuteSave); } - private global::ReactiveUI.ReactiveCommand? _deleteCommand; + private global::ReactiveUI.ReactiveCommand? _deleteCommand; [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand DeleteCommand { get => _deleteCommand ??= global::ReactiveUI.ReactiveCommand.Create(Delete, CanExecuteDelete); } - private global::ReactiveUI.ReactiveCommand? _calculateCommand; + private global::ReactiveUI.ReactiveCommand? _calculateCommand; [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] internal global::ReactiveUI.ReactiveCommand CalculateCommand { get => _calculateCommand ??= global::ReactiveUI.ReactiveCommand.Create(Calculate); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.AsyncWithParam#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInDeeplyNestClass#RxCmdAttr.verified.cs similarity index 95% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.AsyncWithParam#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInDeeplyNestClass#RxCmdAttr.verified.cs index b0534866..0f45d48c 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.AsyncWithParam#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInDeeplyNestClass#RxCmdAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs // Copyright (c) 2026 .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. diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInDeeplyNestClass#TestNs.Outer+Middle+Inner+Deepest.RxCmds.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInDeeplyNestClass#TestNs.Outer+Middle+Inner+Deepest.RxCmds.verified.cs new file mode 100644 index 00000000..90f0d7c4 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInDeeplyNestClass#TestNs.Outer+Middle+Inner+Deepest.RxCmds.verified.cs @@ -0,0 +1,27 @@ +//HintName: TestNs.Outer+Middle+Inner+Deepest.ReactiveCommands.g.cs +// + +#pragma warning disable +#nullable enable + +namespace TestNs +{ + public partial class Outer + { + public partial class Middle + { + public partial class Inner + { + public partial class Deepest + { + private global::ReactiveUI.ReactiveCommand? _deepestCommandCommand; + + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public global::ReactiveUI.ReactiveCommand DeepestCommandCommand { get => _deepestCommandCommand ??= global::ReactiveUI.ReactiveCommand.Create(DeepestCommand); } + } + } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInDeeplyNestClass#TestNs.Outer+Middle+Inner.RxCmds.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInDeeplyNestClass#TestNs.Outer+Middle+Inner.RxCmds.verified.cs new file mode 100644 index 00000000..807c335d --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInDeeplyNestClass#TestNs.Outer+Middle+Inner.RxCmds.verified.cs @@ -0,0 +1,24 @@ +//HintName: TestNs.Outer+Middle+Inner.ReactiveCommands.g.cs +// + +#pragma warning disable +#nullable enable + +namespace TestNs +{ + public partial class Outer + { + public partial class Middle + { + public partial class Inner + { + private global::ReactiveUI.ReactiveCommand? _innerCommandCommand; + + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public global::ReactiveUI.ReactiveCommand InnerCommandCommand { get => _innerCommandCommand ??= global::ReactiveUI.ReactiveCommand.Create(InnerCommand); } + } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInDeeplyNestClass#TestNs.Outer+Middle.RxCmds.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInDeeplyNestClass#TestNs.Outer+Middle.RxCmds.verified.cs new file mode 100644 index 00000000..9f989451 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInDeeplyNestClass#TestNs.Outer+Middle.RxCmds.verified.cs @@ -0,0 +1,21 @@ +//HintName: TestNs.Outer+Middle.ReactiveCommands.g.cs +// + +#pragma warning disable +#nullable enable + +namespace TestNs +{ + public partial class Outer + { + public partial class Middle + { + private global::ReactiveUI.ReactiveCommand? _middleCommandCommand; + + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public global::ReactiveUI.ReactiveCommand MiddleCommandCommand { get => _middleCommandCommand ??= global::ReactiveUI.ReactiveCommand.CreateFromTask(MiddleCommand); } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInDeeplyNestedClass#TestNs.Outer.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInDeeplyNestClass#TestNs.Outer.RxCmds.verified.cs similarity index 95% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInDeeplyNestedClass#TestNs.Outer.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInDeeplyNestClass#TestNs.Outer.RxCmds.verified.cs index 3b0b8370..b59d8416 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInDeeplyNestedClass#TestNs.Outer.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInDeeplyNestClass#TestNs.Outer.RxCmds.verified.cs @@ -6,15 +6,13 @@ namespace TestNs { - public partial class Outer { private global::ReactiveUI.ReactiveCommand? _outerCommandCommand; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand OuterCommandCommand { get => _outerCommandCommand ??= global::ReactiveUI.ReactiveCommand.Create(OuterCommand); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Basic#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInGenClass#RxCmdAttr.verified.cs similarity index 95% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Basic#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInGenClass#RxCmdAttr.verified.cs index b0534866..0f45d48c 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Basic#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInGenClass#RxCmdAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs // Copyright (c) 2026 .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. diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInGenericClass#TestNs.GenericVM`1.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInGenClass#TestNs.GenVM`1.RxCmds.verified.cs similarity index 90% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInGenericClass#TestNs.GenericVM`1.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInGenClass#TestNs.GenVM`1.RxCmds.verified.cs index 33a9bda8..08f36a95 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInGenericClass#TestNs.GenericVM`1.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInGenClass#TestNs.GenVM`1.RxCmds.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.GenericVM`1.ReactiveCommands.g.cs +//HintName: TestNs.GenericVM`1.ReactiveCommands.g.cs // #pragma warning disable @@ -6,20 +6,18 @@ namespace TestNs { - public partial class GenericVM { private global::ReactiveUI.ReactiveCommand? _processItemCommand; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand ProcessItemCommand { get => _processItemCommand ??= global::ReactiveUI.ReactiveCommand.Create(ProcessItem); } - private global::ReactiveUI.ReactiveCommand? _processItemLaterCommand; + private global::ReactiveUI.ReactiveCommand? _processItemLaterCommand; [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand ProcessItemLaterCommand { get => _processItemLaterCommand ??= global::ReactiveUI.ReactiveCommand.CreateFromTask(ProcessItemLater); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveAsyncCommand#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInRecordClass#RxCmdAttr.verified.cs similarity index 95% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveAsyncCommand#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInRecordClass#RxCmdAttr.verified.cs index b0534866..0f45d48c 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveAsyncCommand#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInRecordClass#RxCmdAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs // Copyright (c) 2026 .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. diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInRecordClass#TestNs.TestVMRecord.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInRecordClass#TestNs.TestVMRecord.RxCmds.verified.cs similarity index 97% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInRecordClass#TestNs.TestVMRecord.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInRecordClass#TestNs.TestVMRecord.RxCmds.verified.cs index 906549b5..450fa523 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInRecordClass#TestNs.TestVMRecord.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdInRecordClass#TestNs.TestVMRecord.RxCmds.verified.cs @@ -6,20 +6,18 @@ namespace TestNs { - public partial record TestVMRecord { private global::ReactiveUI.ReactiveCommand? _doSomethingCommand; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand DoSomethingCommand { get => _doSomethingCommand ??= global::ReactiveUI.ReactiveCommand.Create(DoSomething); } - private global::ReactiveUI.ReactiveCommand? _getValueCommand; + private global::ReactiveUI.ReactiveCommand? _getValueCommand; [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand GetValueCommand { get => _getValueCommand ??= global::ReactiveUI.ReactiveCommand.CreateFromTask(GetValueAsync); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWArrayParam#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWArrayParam#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWArrayParam#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithArrayParameter#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWArrayParam#TestNs.TestVM.RxCmds.verified.cs similarity index 91% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithArrayParameter#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWArrayParam#TestNs.TestVM.RxCmds.verified.cs index 1ed31895..a2792940 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithArrayParameter#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWArrayParam#TestNs.TestVM.RxCmds.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.ReactiveCommands.g.cs +//HintName: TestNs.TestVM.ReactiveCommands.g.cs // #pragma warning disable @@ -6,20 +6,18 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand? _sumArrayCommand; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand SumArrayCommand { get => _sumArrayCommand ??= global::ReactiveUI.ReactiveCommand.Create(SumArray); } - private global::ReactiveUI.ReactiveCommand? _processStringsCommand; + private global::ReactiveUI.ReactiveCommand? _processStringsCommand; [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand ProcessStringsCommand { get => _processStringsCommand ??= global::ReactiveUI.ReactiveCommand.Create(ProcessStrings); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCanExecute#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCanExecute#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCanExecute#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCanExecute#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCanExecute#TestNs.TestVM.RxCmds.verified.cs similarity index 95% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCanExecute#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCanExecute#TestNs.TestVM.RxCmds.verified.cs index a08b7075..8fbbf4a9 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCanExecute#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCanExecute#TestNs.TestVM.RxCmds.verified.cs @@ -6,15 +6,13 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand? _doWorkCommand; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand DoWorkCommand { get => _doWorkCommand ??= global::ReactiveUI.ReactiveCommand.Create(DoWork, CanDoWork); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCanExecuteMethod#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCanExecuteMethod#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCanExecuteMethod#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCanExecuteMethod#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCanExecuteMethod#TestNs.TestVM.RxCmds.verified.cs similarity index 95% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCanExecuteMethod#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCanExecuteMethod#TestNs.TestVM.RxCmds.verified.cs index b764dc1c..d4db1b27 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCanExecuteMethod#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCanExecuteMethod#TestNs.TestVM.RxCmds.verified.cs @@ -6,15 +6,13 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand? _runCommand; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand RunCommand { get => _runCommand ??= global::ReactiveUI.ReactiveCommand.Create(Run, CanRun()); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCanExecuteScheduler#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCanExecuteScheduler#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCanExecuteScheduler#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCanExecuteAndScheduler#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCanExecuteScheduler#TestNs.TestVM.RxCmds.verified.cs similarity index 95% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCanExecuteAndScheduler#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCanExecuteScheduler#TestNs.TestVM.RxCmds.verified.cs index 948e72ac..4b0b0f5b 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCanExecuteAndScheduler#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCanExecuteScheduler#TestNs.TestVM.RxCmds.verified.cs @@ -6,15 +6,13 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand? _executeWithSchedulerCommand; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand ExecuteWithSchedulerCommand { get => _executeWithSchedulerCommand ??= global::ReactiveUI.ReactiveCommand.CreateFromTask(ExecuteWithScheduler, CanExecuteCommand); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCplxGenRetT#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCplxGenRetT#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCplxGenRetT#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithComplexGenericReturnType#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCplxGenRetT#TestNs.TestVM.RxCmds.verified.cs similarity index 97% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithComplexGenericReturnType#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCplxGenRetT#TestNs.TestVM.RxCmds.verified.cs index b914bdac..1f87b397 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithComplexGenericReturnType#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCplxGenRetT#TestNs.TestVM.RxCmds.verified.cs @@ -6,20 +6,18 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand>>? _getComplexDataCommand; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand>> GetComplexDataCommand { get => _getComplexDataCommand ??= global::ReactiveUI.ReactiveCommand.Create(GetComplexData); } - private global::ReactiveUI.ReactiveCommand>? _getAsyncComplexDataCommand; + private global::ReactiveUI.ReactiveCommand>? _getAsyncComplexDataCommand; [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand> GetAsyncComplexDataCommand { get => _getAsyncComplexDataCommand ??= global::ReactiveUI.ReactiveCommand.CreateFromTask(GetAsyncComplexData); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCt#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCt#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCt#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCancellationToken#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCt#TestNs.TestVM.RxCmds.verified.cs similarity index 96% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCancellationToken#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCt#TestNs.TestVM.RxCmds.verified.cs index 93779cd4..81e792a2 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCancellationToken#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCt#TestNs.TestVM.RxCmds.verified.cs @@ -6,15 +6,13 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand? _longRunningOperationCommand; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand LongRunningOperationCommand { get => _longRunningOperationCommand ??= global::ReactiveUI.ReactiveCommand.CreateFromTask(LongRunningOperation); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCtParam#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCtParam#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCtParam#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCancellationTokenAndParameter#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCtParam#TestNs.TestVM.RxCmds.verified.cs similarity index 87% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCancellationTokenAndParameter#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCtParam#TestNs.TestVM.RxCmds.verified.cs index ea062d14..d5103d93 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCancellationTokenAndParameter#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWCtParam#TestNs.TestVM.RxCmds.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.ReactiveCommands.g.cs +//HintName: TestNs.TestVM.ReactiveCommands.g.cs // #pragma warning disable @@ -6,15 +6,13 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand? _processWithCancellationCommand; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand ProcessWithCancellationCommand { get => _processWithCancellationCommand ??= global::ReactiveUI.ReactiveCommand.CreateFromTask(ProcessWithCancellation); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWDelegateParam#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWDelegateParam#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWDelegateParam#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithDelegateParameter#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWDelegateParam#TestNs.TestVM.RxCmds.verified.cs similarity index 97% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithDelegateParameter#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWDelegateParam#TestNs.TestVM.RxCmds.verified.cs index dd6df93d..b3c12a0a 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithDelegateParameter#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWDelegateParam#TestNs.TestVM.RxCmds.verified.cs @@ -6,20 +6,18 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand? _executeActionCommand; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand ExecuteActionCommand { get => _executeActionCommand ??= global::ReactiveUI.ReactiveCommand.Create(ExecuteAction); } - private global::ReactiveUI.ReactiveCommand?, int>? _executeFuncCommand; + private global::ReactiveUI.ReactiveCommand?, int>? _executeFuncCommand; [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand?, int> ExecuteFuncCommand { get => _executeFuncCommand ??= global::ReactiveUI.ReactiveCommand.Create?, int>(ExecuteFunc); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWEnumParam#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWEnumParam#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWEnumParam#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithEnumParameter#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWEnumParam#TestNs.TestVM.RxCmds.verified.cs similarity index 97% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithEnumParameter#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWEnumParam#TestNs.TestVM.RxCmds.verified.cs index 12abdb57..601dd94b 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithEnumParameter#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWEnumParam#TestNs.TestVM.RxCmds.verified.cs @@ -6,20 +6,18 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand? _getStatusMessageCommand; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand GetStatusMessageCommand { get => _getStatusMessageCommand ??= global::ReactiveUI.ReactiveCommand.Create(GetStatusMessage); } - private global::ReactiveUI.ReactiveCommand? _setStatusCommand; + private global::ReactiveUI.ReactiveCommand? _setStatusCommand; [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand SetStatusCommand { get => _setStatusCommand ??= global::ReactiveUI.ReactiveCommand.Create(SetStatus); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWMultiParams#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWMultiParams#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWMultiParams#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithMultipleParameters#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWMultiParams#TestNs.TestVM.RxCmds.verified.cs similarity index 87% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithMultipleParameters#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWMultiParams#TestNs.TestVM.RxCmds.verified.cs index 8fdc3ae3..68cbe615 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithMultipleParameters#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWMultiParams#TestNs.TestVM.RxCmds.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.ReactiveCommands.g.cs +//HintName: TestNs.TestVM.ReactiveCommands.g.cs // #pragma warning disable @@ -6,15 +6,13 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand<(int number, string text), string>? _combineValuesCommand; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand<(int number, string text), string> CombineValuesCommand { get => _combineValuesCommand ??= global::ReactiveUI.ReactiveCommand.Create<(int number, string text), string>(CombineValues); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWNullParam#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWNullParam#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWNullParam#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithNullableParameter#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWNullParam#TestNs.TestVM.RxCmds.verified.cs similarity index 91% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithNullableParameter#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWNullParam#TestNs.TestVM.RxCmds.verified.cs index d1300a08..412edf3c 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithNullableParameter#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWNullParam#TestNs.TestVM.RxCmds.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.ReactiveCommands.g.cs +//HintName: TestNs.TestVM.ReactiveCommands.g.cs // #pragma warning disable @@ -6,20 +6,18 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand? _processNullableCommand; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand ProcessNullableCommand { get => _processNullableCommand ??= global::ReactiveUI.ReactiveCommand.Create(ProcessNullable); } - private global::ReactiveUI.ReactiveCommand? _processNullableIntCommand; + private global::ReactiveUI.ReactiveCommand? _processNullableIntCommand; [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand ProcessNullableIntCommand { get => _processNullableIntCommand ??= global::ReactiveUI.ReactiveCommand.Create(ProcessNullableInt); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWObsRet#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWObsRet#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWObsRet#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithObservableReturn#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWObsRet#TestNs.TestVM.RxCmds.verified.cs similarity index 95% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithObservableReturn#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWObsRet#TestNs.TestVM.RxCmds.verified.cs index b8cc49f3..9ffe958d 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithObservableReturn#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWObsRet#TestNs.TestVM.RxCmds.verified.cs @@ -6,15 +6,13 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand? _getObservableSequenceCommand; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand GetObservableSequenceCommand { get => _getObservableSequenceCommand ??= global::ReactiveUI.ReactiveCommand.CreateFromObservable(GetObservableSequence); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWPrivateAcc#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWPrivateAcc#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWPrivateAcc#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithPrivateAccess#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWPrivateAcc#TestNs.TestVM.RxCmds.verified.cs similarity index 95% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithPrivateAccess#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWPrivateAcc#TestNs.TestVM.RxCmds.verified.cs index a58ae7e2..38fe8c84 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithPrivateAccess#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWPrivateAcc#TestNs.TestVM.RxCmds.verified.cs @@ -6,15 +6,13 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand? _privateCommandCommand; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] private global::ReactiveUI.ReactiveCommand PrivateCommandCommand { get => _privateCommandCommand ??= global::ReactiveUI.ReactiveCommand.Create(PrivateCommand); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWProtectedAcc#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWProtectedAcc#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWProtectedAcc#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithProtectedAccess#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWProtectedAcc#TestNs.TestVM.RxCmds.verified.cs similarity index 95% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithProtectedAccess#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWProtectedAcc#TestNs.TestVM.RxCmds.verified.cs index 92c96a39..84c0b4f9 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithProtectedAccess#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWProtectedAcc#TestNs.TestVM.RxCmds.verified.cs @@ -6,15 +6,13 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand? _protectedCommandCommand; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] protected global::ReactiveUI.ReactiveCommand ProtectedCommandCommand { get => _protectedCommandCommand ??= global::ReactiveUI.ReactiveCommand.Create(ProtectedCommand); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWTaskOfNullRet#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWTaskOfNullRet#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWTaskOfNullRet#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithTaskOfNullableReturn#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWTaskOfNullRet#TestNs.TestVM.RxCmds.verified.cs similarity index 97% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithTaskOfNullableReturn#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWTaskOfNullRet#TestNs.TestVM.RxCmds.verified.cs index 63b877ed..6aba5b81 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithTaskOfNullableReturn#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWTaskOfNullRet#TestNs.TestVM.RxCmds.verified.cs @@ -6,20 +6,18 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand? _getNullableStringCommand; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand GetNullableStringCommand { get => _getNullableStringCommand ??= global::ReactiveUI.ReactiveCommand.CreateFromTask(GetNullableStringAsync); } - private global::ReactiveUI.ReactiveCommand? _getNullableIntCommand; + private global::ReactiveUI.ReactiveCommand? _getNullableIntCommand; [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand GetNullableIntCommand { get => _getNullableIntCommand ??= global::ReactiveUI.ReactiveCommand.CreateFromTask(GetNullableIntAsync); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWTupleRetT#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWTupleRetT#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWTupleRetT#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithTupleReturnType#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWTupleRetT#TestNs.TestVM.RxCmds.verified.cs similarity index 97% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithTupleReturnType#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWTupleRetT#TestNs.TestVM.RxCmds.verified.cs index dd6f90f7..335784a6 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithTupleReturnType#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWTupleRetT#TestNs.TestVM.RxCmds.verified.cs @@ -6,20 +6,18 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand? _getNamedTupleCommand; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand GetNamedTupleCommand { get => _getNamedTupleCommand ??= global::ReactiveUI.ReactiveCommand.Create(GetNamedTuple); } - private global::ReactiveUI.ReactiveCommand? _getAsyncTupleCommand; + private global::ReactiveUI.ReactiveCommand? _getAsyncTupleCommand; [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand GetAsyncTupleCommand { get => _getAsyncTupleCommand ??= global::ReactiveUI.ReactiveCommand.CreateFromTask(GetAsyncTuple); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWValueTask#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWValueTask#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWValueTask#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithValueTask#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWValueTask#TestNs.TestVM.RxCmds.verified.cs similarity index 97% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithValueTask#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWValueTask#TestNs.TestVM.RxCmds.verified.cs index 2d607288..071843d7 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithValueTask#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdWValueTask#TestNs.TestVM.RxCmds.verified.cs @@ -6,20 +6,18 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand? _doValueTaskWorkCommand; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand DoValueTaskWorkCommand { get => _doValueTaskWorkCommand ??= global::ReactiveUI.ReactiveCommand.Create(DoValueTaskWork); } - private global::ReactiveUI.ReactiveCommand>? _getValueTaskResultCommand; + private global::ReactiveUI.ReactiveCommand>? _getValueTaskResultCommand; [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand> GetValueTaskResultCommand { get => _getValueTaskResultCommand ??= global::ReactiveUI.ReactiveCommand.Create(GetValueTaskResult); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdsAcrossPartialDeclarations#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdsAcrossPartialDeclarations#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdsAcrossPartialDeclarations#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandsAcrossPartialDeclarations#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdsAcrossPartialDeclarations#TestNs.TestVM.RxCmds.verified.cs similarity index 97% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandsAcrossPartialDeclarations#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdsAcrossPartialDeclarations#TestNs.TestVM.RxCmds.verified.cs index 88ee9a07..6dc84ff9 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandsAcrossPartialDeclarations#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCE.FRxCmdsAcrossPartialDeclarations#TestNs.TestVM.RxCmds.verified.cs @@ -6,20 +6,18 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand? _createCommand; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand CreateCommand { get => _createCommand ??= global::ReactiveUI.ReactiveCommand.Create(Create); } - private global::ReactiveUI.ReactiveCommand? _loadCommand; + private global::ReactiveUI.ReactiveCommand? _loadCommand; [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand LoadCommand { get => _loadCommand ??= global::ReactiveUI.ReactiveCommand.CreateFromTask(LoadAsync); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Acc#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Acc#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Acc#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Access#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Acc#TestNs.TestVM.RxCmds.verified.cs similarity index 95% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Access#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Acc#TestNs.TestVM.RxCmds.verified.cs index 1d9a3fe9..09d9310c 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Access#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Acc#TestNs.TestVM.RxCmds.verified.cs @@ -6,15 +6,13 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand? _test1Command; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] internal global::ReactiveUI.ReactiveCommand Test1Command { get => _test1Command ??= global::ReactiveUI.ReactiveCommand.Create(Test1); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.AsyncWParam#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.AsyncWParam#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.AsyncWParam#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.AsyncWithParam#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.AsyncWParam#TestNs.TestVM.RxCmds.verified.cs similarity index 95% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.AsyncWithParam#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.AsyncWParam#TestNs.TestVM.RxCmds.verified.cs index 0d1250a0..545cf2f8 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.AsyncWithParam#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.AsyncWParam#TestNs.TestVM.RxCmds.verified.cs @@ -6,15 +6,13 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand? _test3Command; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand Test3Command { get => _test3Command ??= global::ReactiveUI.ReactiveCommand.CreateFromTask(Test3); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Basic#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Basic#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Basic#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Basic#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Basic#TestNs.TestVM.RxCmds.verified.cs similarity index 95% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Basic#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Basic#TestNs.TestVM.RxCmds.verified.cs index 76df3c5a..d263e8f2 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Basic#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Basic#TestNs.TestVM.RxCmds.verified.cs @@ -6,15 +6,13 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand? _test1Command; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand Test1Command { get => _test1Command ??= global::ReactiveUI.ReactiveCommand.Create(Test1); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.FRxAsyncCmd#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.FRxAsyncCmd#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.FRxAsyncCmd#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveAsyncCommand#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.FRxAsyncCmd#TestNs.TestVM.RxCmds.verified.cs similarity index 95% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveAsyncCommand#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.FRxAsyncCmd#TestNs.TestVM.RxCmds.verified.cs index 805de3be..d41c6091 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveAsyncCommand#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.FRxAsyncCmd#TestNs.TestVM.RxCmds.verified.cs @@ -6,15 +6,13 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand? _test1Command; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand Test1Command { get => _test1Command ??= global::ReactiveUI.ReactiveCommand.CreateFromTask(Test1); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Nest#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Nest#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Nest#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Nest#TestNs.TestVm3+TestInnerClass1.RxCmds.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Nest#TestNs.TestVm3+TestInnerClass1.RxCmds.verified.cs new file mode 100644 index 00000000..f6292e02 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Nest#TestNs.TestVm3+TestInnerClass1.RxCmds.verified.cs @@ -0,0 +1,21 @@ +//HintName: TestNs.TestViewModel3+TestInnerClass1.ReactiveCommands.g.cs +// + +#pragma warning disable +#nullable enable + +namespace TestNs +{ + public partial class TestViewModel3 + { + public partial class TestInnerClass1 + { + private global::ReactiveUI.ReactiveCommand? _testI1Command; + + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public global::ReactiveUI.ReactiveCommand TestI1Command { get => _testI1Command ??= global::ReactiveUI.ReactiveCommand.Create(TestI1); } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Nest#TestNs.TestVm3+TestInnerClass2+TestInnerClass3.RxCmds.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Nest#TestNs.TestVm3+TestInnerClass2+TestInnerClass3.RxCmds.verified.cs new file mode 100644 index 00000000..9f41689a --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Nest#TestNs.TestVm3+TestInnerClass2+TestInnerClass3.RxCmds.verified.cs @@ -0,0 +1,24 @@ +//HintName: TestNs.TestViewModel3+TestInnerClass2+TestInnerClass3.ReactiveCommands.g.cs +// + +#pragma warning disable +#nullable enable + +namespace TestNs +{ + public partial class TestViewModel3 + { + public partial class TestInnerClass2 + { + public partial class TestInnerClass3 + { + private global::ReactiveUI.ReactiveCommand? _testI3Command; + + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public global::ReactiveUI.ReactiveCommand TestI3Command { get => _testI3Command ??= global::ReactiveUI.ReactiveCommand.Create(TestI3); } + } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Nest#TestNs.TestVm3+TestInnerClass2.RxCmds.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Nest#TestNs.TestVm3+TestInnerClass2.RxCmds.verified.cs new file mode 100644 index 00000000..af1b0e15 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Nest#TestNs.TestVm3+TestInnerClass2.RxCmds.verified.cs @@ -0,0 +1,21 @@ +//HintName: TestNs.TestViewModel3+TestInnerClass2.ReactiveCommands.g.cs +// + +#pragma warning disable +#nullable enable + +namespace TestNs +{ + public partial class TestViewModel3 + { + public partial class TestInnerClass2 + { + private global::ReactiveUI.ReactiveCommand? _testI2Command; + + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public global::ReactiveUI.ReactiveCommand TestI2Command { get => _testI2Command ??= global::ReactiveUI.ReactiveCommand.Create(TestI2); } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Nested#TestNs.TestViewModel3.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Nest#TestNs.TestVm3.RxCmds.verified.cs similarity index 95% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Nested#TestNs.TestViewModel3.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Nest#TestNs.TestVm3.RxCmds.verified.cs index a05aefdb..75e245da 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Nested#TestNs.TestViewModel3.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Nest#TestNs.TestVm3.RxCmds.verified.cs @@ -6,15 +6,13 @@ namespace TestNs { - public partial class TestViewModel3 { private global::ReactiveUI.ReactiveCommand? _test1Command; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand Test1Command { get => _test1Command ??= global::ReactiveUI.ReactiveCommand.Create(Test1); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.NullTRet#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.NullTRet#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.NullTRet#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.NullableTypeReturn#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.NullTRet#TestNs.TestVM.RxCmds.verified.cs similarity index 88% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.NullableTypeReturn#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.NullTRet#TestNs.TestVM.RxCmds.verified.cs index 4fceb7d2..681eaf98 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.NullableTypeReturn#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.NullTRet#TestNs.TestVM.RxCmds.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.ReactiveCommands.g.cs +//HintName: TestNs.TestVM.ReactiveCommands.g.cs // #pragma warning disable @@ -6,15 +6,13 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand? _test1Command; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand Test1Command { get => _test1Command ??= global::ReactiveUI.ReactiveCommand.Create(Test1); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.RunInBackground#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.RunInBackground#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.RunInBackground#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.RunInBackground#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.RunInBackground#TestNs.TestVM.RxCmds.verified.cs similarity index 95% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.RunInBackground#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.RunInBackground#TestNs.TestVM.RxCmds.verified.cs index 29ff9c03..a0acdee3 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.RunInBackground#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.RunInBackground#TestNs.TestVM.RxCmds.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.ReactiveCommands.g.cs +//HintName: TestNs.TestVM.ReactiveCommands.g.cs // #pragma warning disable @@ -6,30 +6,28 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand? _saveCommand; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand SaveCommand { get => _saveCommand ??= global::ReactiveUI.ReactiveCommand.CreateRunInBackground(Save); } - private global::ReactiveUI.ReactiveCommand? _calculateCommand; + private global::ReactiveUI.ReactiveCommand? _calculateCommand; [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand CalculateCommand { get => _calculateCommand ??= global::ReactiveUI.ReactiveCommand.CreateRunInBackground(Calculate); } - private global::ReactiveUI.ReactiveCommand? _formatCommand; + private global::ReactiveUI.ReactiveCommand? _formatCommand; [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand FormatCommand { get => _formatCommand ??= global::ReactiveUI.ReactiveCommand.CreateRunInBackground(Format, CanRun, backgroundScheduler: null, outputScheduler: global::ReactiveUI.RxSchedulers.MainThreadScheduler); } - private global::ReactiveUI.ReactiveCommand? _foregroundCommand; + private global::ReactiveUI.ReactiveCommand? _foregroundCommand; [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand ForegroundCommand { get => _foregroundCommand ??= global::ReactiveUI.ReactiveCommand.Create(Foreground); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Scheduler#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Scheduler#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Scheduler#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Scheduler#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Scheduler#TestNs.TestVM.RxCmds.verified.cs similarity index 95% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Scheduler#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Scheduler#TestNs.TestVM.RxCmds.verified.cs index 76df3c5a..d263e8f2 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Scheduler#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.Scheduler#TestNs.TestVM.RxCmds.verified.cs @@ -6,15 +6,13 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand? _test1Command; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand Test1Command { get => _test1Command ??= global::ReactiveUI.ReactiveCommand.Create(Test1); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.WParam#RxCmdAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.WParam#RxCmdAttr.verified.cs new file mode 100644 index 00000000..0f45d48c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.WParam#RxCmdAttr.verified.cs @@ -0,0 +1,52 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. + /// + /// + /// to create the command with ReactiveCommand.CreateRunInBackground. + /// + public bool RunInBackground { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.WithParam#TestNs.TestVM.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.WParam#TestNs.TestVM.RxCmds.verified.cs similarity index 85% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.WithParam#TestNs.TestVM.ReactiveCommands.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.WParam#TestNs.TestVM.RxCmds.verified.cs index c8e086dd..49e8f5b9 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.WithParam#TestNs.TestVM.ReactiveCommands.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RCMDG.WParam#TestNs.TestVM.RxCmds.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.ReactiveCommands.g.cs +//HintName: TestNs.TestVM.ReactiveCommands.g.cs // #pragma warning disable @@ -6,15 +6,13 @@ namespace TestNs { - public partial class TestVM { private global::ReactiveUI.ReactiveCommand? _test3Command; - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::ReactiveUI.ReactiveCommand Test3Command { get => _test3Command ??= global::ReactiveUI.ReactiveCommand.Create(Test3); } } } #nullable restore -#pragma warning restore \ No newline at end of file +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Nested#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Nested#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Nested#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Nested#TestNs.TestViewModel3+TestInnerClass1.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Nested#TestNs.TestViewModel3+TestInnerClass1.ReactiveCommands.g.verified.cs deleted file mode 100644 index 6eed3de1..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Nested#TestNs.TestViewModel3+TestInnerClass1.ReactiveCommands.g.verified.cs +++ /dev/null @@ -1,24 +0,0 @@ -//HintName: TestNs.TestViewModel3+TestInnerClass1.ReactiveCommands.g.cs -// - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - public partial class TestViewModel3 -{ - - public partial class TestInnerClass1 - { - private global::ReactiveUI.ReactiveCommand? _testI1Command; - - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::ReactiveUI.ReactiveCommand TestI1Command { get => _testI1Command ??= global::ReactiveUI.ReactiveCommand.Create(TestI1); } - } -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Nested#TestNs.TestViewModel3+TestInnerClass2+TestInnerClass3.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Nested#TestNs.TestViewModel3+TestInnerClass2+TestInnerClass3.ReactiveCommands.g.verified.cs deleted file mode 100644 index 59f9102a..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Nested#TestNs.TestViewModel3+TestInnerClass2+TestInnerClass3.ReactiveCommands.g.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//HintName: TestNs.TestViewModel3+TestInnerClass2+TestInnerClass3.ReactiveCommands.g.cs -// - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - public partial class TestViewModel3 -{ -public partial class TestInnerClass2 -{ - - public partial class TestInnerClass3 - { - private global::ReactiveUI.ReactiveCommand? _testI3Command; - - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::ReactiveUI.ReactiveCommand TestI3Command { get => _testI3Command ??= global::ReactiveUI.ReactiveCommand.Create(TestI3); } - } -} -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Nested#TestNs.TestViewModel3+TestInnerClass2.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Nested#TestNs.TestViewModel3+TestInnerClass2.ReactiveCommands.g.verified.cs deleted file mode 100644 index 01895dd3..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Nested#TestNs.TestViewModel3+TestInnerClass2.ReactiveCommands.g.verified.cs +++ /dev/null @@ -1,24 +0,0 @@ -//HintName: TestNs.TestViewModel3+TestInnerClass2.ReactiveCommands.g.cs -// - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - public partial class TestViewModel3 -{ - - public partial class TestInnerClass2 - { - private global::ReactiveUI.ReactiveCommand? _testI2Command; - - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::ReactiveUI.ReactiveCommand TestI2Command { get => _testI2Command ??= global::ReactiveUI.ReactiveCommand.Create(TestI2); } - } -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.NullableTypeReturn#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.NullableTypeReturn#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.NullableTypeReturn#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.RunInBackground#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.RunInBackground#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.RunInBackground#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Scheduler#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Scheduler#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.Scheduler#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.WithParam#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.WithParam#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.WithParam#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromMultipleReactiveCommands#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromMultipleReactiveCommands#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromMultipleReactiveCommands#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInDeeplyNestedClass#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInDeeplyNestedClass#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInDeeplyNestedClass#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInDeeplyNestedClass#TestNs.Outer+Middle+Inner+Deepest.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInDeeplyNestedClass#TestNs.Outer+Middle+Inner+Deepest.ReactiveCommands.g.verified.cs deleted file mode 100644 index decaca19..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInDeeplyNestedClass#TestNs.Outer+Middle+Inner+Deepest.ReactiveCommands.g.verified.cs +++ /dev/null @@ -1,30 +0,0 @@ -//HintName: TestNs.Outer+Middle+Inner+Deepest.ReactiveCommands.g.cs -// - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - public partial class Outer -{ -public partial class Middle -{ -public partial class Inner -{ - - public partial class Deepest - { - private global::ReactiveUI.ReactiveCommand? _deepestCommandCommand; - - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::ReactiveUI.ReactiveCommand DeepestCommandCommand { get => _deepestCommandCommand ??= global::ReactiveUI.ReactiveCommand.Create(DeepestCommand); } - } -} -} -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInDeeplyNestedClass#TestNs.Outer+Middle+Inner.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInDeeplyNestedClass#TestNs.Outer+Middle+Inner.ReactiveCommands.g.verified.cs deleted file mode 100644 index e64eaf9b..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInDeeplyNestedClass#TestNs.Outer+Middle+Inner.ReactiveCommands.g.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//HintName: TestNs.Outer+Middle+Inner.ReactiveCommands.g.cs -// - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - public partial class Outer -{ -public partial class Middle -{ - - public partial class Inner - { - private global::ReactiveUI.ReactiveCommand? _innerCommandCommand; - - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::ReactiveUI.ReactiveCommand InnerCommandCommand { get => _innerCommandCommand ??= global::ReactiveUI.ReactiveCommand.Create(InnerCommand); } - } -} -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInDeeplyNestedClass#TestNs.Outer+Middle.ReactiveCommands.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInDeeplyNestedClass#TestNs.Outer+Middle.ReactiveCommands.g.verified.cs deleted file mode 100644 index 81731555..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInDeeplyNestedClass#TestNs.Outer+Middle.ReactiveCommands.g.verified.cs +++ /dev/null @@ -1,24 +0,0 @@ -//HintName: TestNs.Outer+Middle.ReactiveCommands.g.cs -// - -#pragma warning disable -#nullable enable - -namespace TestNs -{ - public partial class Outer -{ - - public partial class Middle - { - private global::ReactiveUI.ReactiveCommand? _middleCommandCommand; - - - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::ReactiveUI.ReactiveCommand MiddleCommandCommand { get => _middleCommandCommand ??= global::ReactiveUI.ReactiveCommand.CreateFromTask(MiddleCommand); } - } -} - -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInGenericClass#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInGenericClass#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInGenericClass#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInRecordClass#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInRecordClass#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandInRecordClass#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithArrayParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithArrayParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithArrayParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCanExecute#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCanExecute#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCanExecute#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCanExecuteAndScheduler#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCanExecuteAndScheduler#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCanExecuteAndScheduler#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCanExecuteMethod#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCanExecuteMethod#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCanExecuteMethod#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCancellationToken#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCancellationToken#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCancellationToken#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCancellationTokenAndParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCancellationTokenAndParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithCancellationTokenAndParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithComplexGenericReturnType#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithComplexGenericReturnType#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithComplexGenericReturnType#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithDelegateParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithDelegateParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithDelegateParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithEnumParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithEnumParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithEnumParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithMultipleParameters#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithMultipleParameters#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithMultipleParameters#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithNullableParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithNullableParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithNullableParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithObservableReturn#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithObservableReturn#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithObservableReturn#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithPrivateAccess#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithPrivateAccess#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithPrivateAccess#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithProtectedAccess#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithProtectedAccess#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithProtectedAccess#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithTaskOfNullableReturn#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithTaskOfNullableReturn#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithTaskOfNullableReturn#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithTupleReturnType#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithTupleReturnType#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithTupleReturnType#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithValueTask#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithValueTask#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandWithValueTask#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandsAcrossPartialDeclarations#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandsAcrossPartialDeclarations#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs deleted file mode 100644 index b0534866..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/RxCmdExtTests.FromReactiveCommandsAcrossPartialDeclarations#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets a value indicating whether a synchronous method runs on ReactiveUI's background scheduler. - /// - /// - /// to create the command with ReactiveCommand.CreateRunInBackground. - /// - public bool RunInBackground { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/ReactiveCollectionGeneratorTests.BasicField#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.ByteArray#RxCollAttr.verified.cs similarity index 90% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/ReactiveCollectionGeneratorTests.BasicField#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.ByteArray#RxCollAttr.verified.cs index 89bb3391..4bef164c 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/ReactiveCollectionGeneratorTests.BasicField#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.ByteArray#RxCollAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs // Copyright (c) 2026 .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. diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.ByteArray#TestNs.TestVM.RxColls.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.ByteArray#TestNs.TestVM.RxColls.verified.cs new file mode 100644 index 00000000..9bceb0b7 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.ByteArray#TestNs.TestVM.RxColls.verified.cs @@ -0,0 +1,38 @@ +//HintName: TestNs.TestVM.ReactiveCollections.g.cs +// +using ReactiveUI; + +#pragma warning disable +#nullable enable +namespace TestNs +{ + public partial class TestVM + { + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _binaryDataCollectionChangedHandler; + + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public global::System.Collections.ObjectModel.ObservableCollection? BinaryData + { + get => _binaryData; + set + { + var handler = _binaryDataCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(BinaryData)); + if (_binaryData != null) + { + _binaryData.CollectionChanged -= handler; + } + + _binaryData = value; + this.RaisePropertyChanged(nameof(BinaryData)); + + if (value != null) + { + value.CollectionChanged += handler; + } + } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.ByteArray#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.CplxT#RxCollAttr.verified.cs similarity index 90% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.ByteArray#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.CplxT#RxCollAttr.verified.cs index 89bb3391..4bef164c 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.ByteArray#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.CplxT#RxCollAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs // Copyright (c) 2026 .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. diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.CplxT#TestNs.TestVM.RxColls.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.CplxT#TestNs.TestVM.RxColls.verified.cs new file mode 100644 index 00000000..240db87c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.CplxT#TestNs.TestVM.RxColls.verified.cs @@ -0,0 +1,38 @@ +//HintName: TestNs.TestVM.ReactiveCollections.g.cs +// +using ReactiveUI; + +#pragma warning disable +#nullable enable +namespace TestNs +{ + public partial class TestVM + { + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _itemsCollectionChangedHandler; + + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public global::System.Collections.ObjectModel.ObservableCollection? Items + { + get => _items; + set + { + var handler = _itemsCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(Items)); + if (_items != null) + { + _items.CollectionChanged -= handler; + } + + _items = value; + this.RaisePropertyChanged(nameof(Items)); + + if (value != null) + { + value.CollectionChanged += handler; + } + } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.ComplexType#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.DateTime#RxCollAttr.verified.cs similarity index 90% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.ComplexType#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.DateTime#RxCollAttr.verified.cs index 89bb3391..4bef164c 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.ComplexType#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.DateTime#RxCollAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs // Copyright (c) 2026 .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. diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.DateTime#TestNs.TestVM.ReactiveCollections.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.DateTime#TestNs.TestVM.RxColls.verified.cs similarity index 52% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.DateTime#TestNs.TestVM.ReactiveCollections.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.DateTime#TestNs.TestVM.RxColls.verified.cs index d9acf853..04b69f3d 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.DateTime#TestNs.TestVM.ReactiveCollections.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.DateTime#TestNs.TestVM.RxColls.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.ReactiveCollections.g.cs +//HintName: TestNs.TestVM.ReactiveCollections.g.cs // using ReactiveUI; @@ -6,9 +6,10 @@ #nullable enable namespace TestNs { - public partial class TestVM { + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _datesCollectionChangedHandler; + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Collections.ObjectModel.ObservableCollection? Dates @@ -16,23 +17,24 @@ public partial class TestVM get => _dates; set { - if (value == null) + var handler = _datesCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(Dates)); + if (_dates != null) { - Dates.CollectionChanged -= CollectionChanged(this, nameof(Dates)); + _dates.CollectionChanged -= handler; } _dates = value; this.RaisePropertyChanged(nameof(Dates)); - if (_dates != null) + if (value != null) { - // Remove the old handler if it exists - Dates.CollectionChanged -= CollectionChanged(this, nameof(Dates)); - - Dates.CollectionChanged += CollectionChanged(this, nameof(Dates)); + value.CollectionChanged += handler; } } } + + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _timestampsCollectionChangedHandler; + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Collections.ObjectModel.ObservableCollection? Timestamps @@ -40,27 +42,22 @@ public partial class TestVM get => _timestamps; set { - if (value == null) + var handler = _timestampsCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(Timestamps)); + if (_timestamps != null) { - Timestamps.CollectionChanged -= CollectionChanged(this, nameof(Timestamps)); + _timestamps.CollectionChanged -= handler; } _timestamps = value; this.RaisePropertyChanged(nameof(Timestamps)); - if (_timestamps != null) + if (value != null) { - // Remove the old handler if it exists - Timestamps.CollectionChanged -= CollectionChanged(this, nameof(Timestamps)); - - Timestamps.CollectionChanged += CollectionChanged(this, nameof(Timestamps)); + value.CollectionChanged += handler; } } } - - [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 +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.DiffNs#Ns1.TestVM.RxColls.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.DiffNs#Ns1.TestVM.RxColls.verified.cs new file mode 100644 index 00000000..f58a67cd --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.DiffNs#Ns1.TestVM.RxColls.verified.cs @@ -0,0 +1,38 @@ +//HintName: Namespace1.TestVM.ReactiveCollections.g.cs +// +using ReactiveUI; + +#pragma warning disable +#nullable enable +namespace Namespace1 +{ + public partial class TestVM + { + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _numbersCollectionChangedHandler; + + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public global::System.Collections.ObjectModel.ObservableCollection? Numbers + { + get => _numbers; + set + { + var handler = _numbersCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(Numbers)); + if (_numbers != null) + { + _numbers.CollectionChanged -= handler; + } + + _numbers = value; + this.RaisePropertyChanged(nameof(Numbers)); + + if (value != null) + { + value.CollectionChanged += handler; + } + } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.DiffNs#Ns2.TestVM.RxColls.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.DiffNs#Ns2.TestVM.RxColls.verified.cs new file mode 100644 index 00000000..095b776e --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.DiffNs#Ns2.TestVM.RxColls.verified.cs @@ -0,0 +1,38 @@ +//HintName: Namespace2.TestVM.ReactiveCollections.g.cs +// +using ReactiveUI; + +#pragma warning disable +#nullable enable +namespace Namespace2 +{ + public partial class TestVM + { + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _namesCollectionChangedHandler; + + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public global::System.Collections.ObjectModel.ObservableCollection? Names + { + get => _names; + set + { + var handler = _namesCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(Names)); + if (_names != null) + { + _names.CollectionChanged -= handler; + } + + _names = value; + this.RaisePropertyChanged(nameof(Names)); + + if (value != null) + { + value.CollectionChanged += handler; + } + } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.DateTime#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.DiffNs#RxCollAttr.verified.cs similarity index 90% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.DateTime#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.DiffNs#RxCollAttr.verified.cs index 89bb3391..4bef164c 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.DateTime#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.DiffNs#RxCollAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs // Copyright (c) 2026 .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. diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Enum#RxCollAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Enum#RxCollAttr.verified.cs new file mode 100644 index 00000000..4bef164c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Enum#RxCollAttr.verified.cs @@ -0,0 +1,19 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs +// Copyright (c) 2026 .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/RCE.Enum#TestNs.TestVM.RxColls.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Enum#TestNs.TestVM.RxColls.verified.cs new file mode 100644 index 00000000..a9f78d87 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Enum#TestNs.TestVM.RxColls.verified.cs @@ -0,0 +1,38 @@ +//HintName: TestNs.TestVM.ReactiveCollections.g.cs +// +using ReactiveUI; + +#pragma warning disable +#nullable enable +namespace TestNs +{ + public partial class TestVM + { + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _statusesCollectionChangedHandler; + + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public global::System.Collections.ObjectModel.ObservableCollection? Statuses + { + get => _statuses; + set + { + var handler = _statusesCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(Statuses)); + if (_statuses != null) + { + _statuses.CollectionChanged -= handler; + } + + _statuses = value; + this.RaisePropertyChanged(nameof(Statuses)); + + if (value != null) + { + value.CollectionChanged += handler; + } + } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Gen#RxCollAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Gen#RxCollAttr.verified.cs new file mode 100644 index 00000000..4bef164c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Gen#RxCollAttr.verified.cs @@ -0,0 +1,19 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs +// Copyright (c) 2026 .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/RCE.Gen#TestNs.GenVM`1.RxColls.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Gen#TestNs.GenVM`1.RxColls.verified.cs new file mode 100644 index 00000000..e0420a30 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Gen#TestNs.GenVM`1.RxColls.verified.cs @@ -0,0 +1,38 @@ +//HintName: TestNs.GenericVM`1.ReactiveCollections.g.cs +// +using ReactiveUI; + +#pragma warning disable +#nullable enable +namespace TestNs +{ + public partial class GenericVM + { + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _itemsCollectionChangedHandler; + + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public global::System.Collections.ObjectModel.ObservableCollection? Items + { + get => _items; + set + { + var handler = _itemsCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(Items)); + if (_items != null) + { + _items.CollectionChanged -= handler; + } + + _items = value; + this.RaisePropertyChanged(nameof(Items)); + + if (value != null) + { + value.CollectionChanged += handler; + } + } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Guid#RxCollAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Guid#RxCollAttr.verified.cs new file mode 100644 index 00000000..4bef164c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Guid#RxCollAttr.verified.cs @@ -0,0 +1,19 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs +// Copyright (c) 2026 .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/RCE.Guid#TestNs.TestVM.RxColls.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Guid#TestNs.TestVM.RxColls.verified.cs new file mode 100644 index 00000000..9f3aca6f --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Guid#TestNs.TestVM.RxColls.verified.cs @@ -0,0 +1,38 @@ +//HintName: TestNs.TestVM.ReactiveCollections.g.cs +// +using ReactiveUI; + +#pragma warning disable +#nullable enable +namespace TestNs +{ + public partial class TestVM + { + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _idsCollectionChangedHandler; + + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public global::System.Collections.ObjectModel.ObservableCollection? Ids + { + get => _ids; + set + { + var handler = _idsCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(Ids)); + if (_ids != null) + { + _ids.CollectionChanged -= handler; + } + + _ids = value; + this.RaisePropertyChanged(nameof(Ids)); + + if (value != null) + { + value.CollectionChanged += handler; + } + } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Interface#RxCollAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Interface#RxCollAttr.verified.cs new file mode 100644 index 00000000..4bef164c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Interface#RxCollAttr.verified.cs @@ -0,0 +1,19 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs +// Copyright (c) 2026 .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/RxCollExtTests.Interface#TestNs.TestVM.ReactiveCollections.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Interface#TestNs.TestVM.RxColls.verified.cs similarity index 52% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Interface#TestNs.TestVM.ReactiveCollections.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Interface#TestNs.TestVM.RxColls.verified.cs index c5a86a70..d3a295dd 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Interface#TestNs.TestVM.ReactiveCollections.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Interface#TestNs.TestVM.RxColls.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.ReactiveCollections.g.cs +//HintName: TestNs.TestVM.ReactiveCollections.g.cs // using ReactiveUI; @@ -6,9 +6,10 @@ #nullable enable namespace TestNs { - public partial class TestVM { + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _itemsCollectionChangedHandler; + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Collections.ObjectModel.ObservableCollection? Items @@ -16,23 +17,24 @@ public partial class TestVM get => _items; set { - if (value == null) + var handler = _itemsCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(Items)); + if (_items != null) { - Items.CollectionChanged -= CollectionChanged(this, nameof(Items)); + _items.CollectionChanged -= handler; } _items = value; this.RaisePropertyChanged(nameof(Items)); - if (_items != null) + if (value != null) { - // Remove the old handler if it exists - Items.CollectionChanged -= CollectionChanged(this, nameof(Items)); - - Items.CollectionChanged += CollectionChanged(this, nameof(Items)); + value.CollectionChanged += handler; } } } + + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _disposablesCollectionChangedHandler; + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Collections.ObjectModel.ObservableCollection? Disposables @@ -40,27 +42,22 @@ public partial class TestVM get => _disposables; set { - if (value == null) + var handler = _disposablesCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(Disposables)); + if (_disposables != null) { - Disposables.CollectionChanged -= CollectionChanged(this, nameof(Disposables)); + _disposables.CollectionChanged -= handler; } _disposables = value; this.RaisePropertyChanged(nameof(Disposables)); - if (_disposables != null) + if (value != null) { - // Remove the old handler if it exists - Disposables.CollectionChanged -= CollectionChanged(this, nameof(Disposables)); - - Disposables.CollectionChanged += CollectionChanged(this, nameof(Disposables)); + value.CollectionChanged += handler; } } } - - [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 +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Multi#RxCollAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Multi#RxCollAttr.verified.cs new file mode 100644 index 00000000..4bef164c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Multi#RxCollAttr.verified.cs @@ -0,0 +1,19 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs +// Copyright (c) 2026 .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/RxCollExtTests.Multiple#TestNs.TestVM.ReactiveCollections.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Multi#TestNs.TestVM.RxColls.verified.cs similarity index 53% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Multiple#TestNs.TestVM.ReactiveCollections.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Multi#TestNs.TestVM.RxColls.verified.cs index 8e142ad6..67b473a1 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Multiple#TestNs.TestVM.ReactiveCollections.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Multi#TestNs.TestVM.RxColls.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.ReactiveCollections.g.cs +//HintName: TestNs.TestVM.ReactiveCollections.g.cs // using ReactiveUI; @@ -6,9 +6,10 @@ #nullable enable namespace TestNs { - public partial class TestVM { + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _namesCollectionChangedHandler; + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Collections.ObjectModel.ObservableCollection? Names @@ -16,23 +17,24 @@ public partial class TestVM get => _names; set { - if (value == null) + var handler = _namesCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(Names)); + if (_names != null) { - Names.CollectionChanged -= CollectionChanged(this, nameof(Names)); + _names.CollectionChanged -= handler; } _names = value; this.RaisePropertyChanged(nameof(Names)); - if (_names != null) + if (value != null) { - // Remove the old handler if it exists - Names.CollectionChanged -= CollectionChanged(this, nameof(Names)); - - Names.CollectionChanged += CollectionChanged(this, nameof(Names)); + value.CollectionChanged += handler; } } } + + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _numbersCollectionChangedHandler; + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Collections.ObjectModel.ObservableCollection? Numbers @@ -40,23 +42,24 @@ public partial class TestVM get => _numbers; set { - if (value == null) + var handler = _numbersCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(Numbers)); + if (_numbers != null) { - Numbers.CollectionChanged -= CollectionChanged(this, nameof(Numbers)); + _numbers.CollectionChanged -= handler; } _numbers = value; this.RaisePropertyChanged(nameof(Numbers)); - if (_numbers != null) + if (value != null) { - // Remove the old handler if it exists - Numbers.CollectionChanged -= CollectionChanged(this, nameof(Numbers)); - - Numbers.CollectionChanged += CollectionChanged(this, nameof(Numbers)); + value.CollectionChanged += handler; } } } + + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _valuesCollectionChangedHandler; + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Collections.ObjectModel.ObservableCollection? Values @@ -64,27 +67,22 @@ public partial class TestVM get => _values; set { - if (value == null) + var handler = _valuesCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(Values)); + if (_values != null) { - Values.CollectionChanged -= CollectionChanged(this, nameof(Values)); + _values.CollectionChanged -= handler; } _values = value; this.RaisePropertyChanged(nameof(Values)); - if (_values != null) + if (value != null) { - // Remove the old handler if it exists - Values.CollectionChanged -= CollectionChanged(this, nameof(Values)); - - Values.CollectionChanged += CollectionChanged(this, nameof(Values)); + value.CollectionChanged += handler; } } } - - [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 +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Nest#RxCollAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Nest#RxCollAttr.verified.cs new file mode 100644 index 00000000..4bef164c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Nest#RxCollAttr.verified.cs @@ -0,0 +1,19 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs +// Copyright (c) 2026 .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/RCE.Nest#TestNs.OuterVM+InnerVM+DeepInnerVM.RxColls.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Nest#TestNs.OuterVM+InnerVM+DeepInnerVM.RxColls.verified.cs new file mode 100644 index 00000000..c96bf723 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Nest#TestNs.OuterVM+InnerVM+DeepInnerVM.RxColls.verified.cs @@ -0,0 +1,44 @@ +//HintName: TestNs.OuterVM+InnerVM+DeepInnerVM.ReactiveCollections.g.cs +// +using ReactiveUI; + +#pragma warning disable +#nullable enable +namespace TestNs +{ + public partial class OuterVM + { + public partial class InnerVM + { + public partial class DeepInnerVM + { + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _deepCollectionCollectionChangedHandler; + + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public global::System.Collections.ObjectModel.ObservableCollection? DeepCollection + { + get => _deepCollection; + set + { + var handler = _deepCollectionCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(DeepCollection)); + if (_deepCollection != null) + { + _deepCollection.CollectionChanged -= handler; + } + + _deepCollection = value; + this.RaisePropertyChanged(nameof(DeepCollection)); + + if (value != null) + { + value.CollectionChanged += handler; + } + } + } + } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Nest#TestNs.OuterVM+InnerVM.RxColls.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Nest#TestNs.OuterVM+InnerVM.RxColls.verified.cs new file mode 100644 index 00000000..e5876b75 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Nest#TestNs.OuterVM+InnerVM.RxColls.verified.cs @@ -0,0 +1,41 @@ +//HintName: TestNs.OuterVM+InnerVM.ReactiveCollections.g.cs +// +using ReactiveUI; + +#pragma warning disable +#nullable enable +namespace TestNs +{ + public partial class OuterVM + { + public partial class InnerVM + { + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _innerCollectionCollectionChangedHandler; + + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public global::System.Collections.ObjectModel.ObservableCollection? InnerCollection + { + get => _innerCollection; + set + { + var handler = _innerCollectionCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(InnerCollection)); + if (_innerCollection != null) + { + _innerCollection.CollectionChanged -= handler; + } + + _innerCollection = value; + this.RaisePropertyChanged(nameof(InnerCollection)); + + if (value != null) + { + value.CollectionChanged += handler; + } + } + } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Nest#TestNs.OuterVM.RxColls.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Nest#TestNs.OuterVM.RxColls.verified.cs new file mode 100644 index 00000000..3db6fc06 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Nest#TestNs.OuterVM.RxColls.verified.cs @@ -0,0 +1,38 @@ +//HintName: TestNs.OuterVM.ReactiveCollections.g.cs +// +using ReactiveUI; + +#pragma warning disable +#nullable enable +namespace TestNs +{ + public partial class OuterVM + { + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _outerCollectionCollectionChangedHandler; + + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public global::System.Collections.ObjectModel.ObservableCollection? OuterCollection + { + get => _outerCollection; + set + { + var handler = _outerCollectionCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(OuterCollection)); + if (_outerCollection != null) + { + _outerCollection.CollectionChanged -= handler; + } + + _outerCollection = value; + this.RaisePropertyChanged(nameof(OuterCollection)); + + if (value != null) + { + value.CollectionChanged += handler; + } + } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Null#RxCollAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Null#RxCollAttr.verified.cs new file mode 100644 index 00000000..4bef164c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Null#RxCollAttr.verified.cs @@ -0,0 +1,19 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs +// Copyright (c) 2026 .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/RxCollExtTests.Nullable#TestNs.TestVM.ReactiveCollections.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Null#TestNs.TestVM.RxColls.verified.cs similarity index 51% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Nullable#TestNs.TestVM.ReactiveCollections.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Null#TestNs.TestVM.RxColls.verified.cs index 60bc3de0..7f2d3ca7 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Nullable#TestNs.TestVM.ReactiveCollections.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Null#TestNs.TestVM.RxColls.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.ReactiveCollections.g.cs +//HintName: TestNs.TestVM.ReactiveCollections.g.cs // using ReactiveUI; @@ -6,9 +6,10 @@ #nullable enable namespace TestNs { - public partial class TestVM { + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _nullableStringsCollectionChangedHandler; + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Collections.ObjectModel.ObservableCollection? NullableStrings @@ -16,23 +17,24 @@ public partial class TestVM get => _nullableStrings; set { - if (value == null) + var handler = _nullableStringsCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(NullableStrings)); + if (_nullableStrings != null) { - NullableStrings.CollectionChanged -= CollectionChanged(this, nameof(NullableStrings)); + _nullableStrings.CollectionChanged -= handler; } _nullableStrings = value; this.RaisePropertyChanged(nameof(NullableStrings)); - if (_nullableStrings != null) + if (value != null) { - // Remove the old handler if it exists - NullableStrings.CollectionChanged -= CollectionChanged(this, nameof(NullableStrings)); - - NullableStrings.CollectionChanged += CollectionChanged(this, nameof(NullableStrings)); + value.CollectionChanged += handler; } } } + + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _nullableIntsCollectionChangedHandler; + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Collections.ObjectModel.ObservableCollection? NullableInts @@ -40,27 +42,22 @@ public partial class TestVM get => _nullableInts; set { - if (value == null) + var handler = _nullableIntsCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(NullableInts)); + if (_nullableInts != null) { - NullableInts.CollectionChanged -= CollectionChanged(this, nameof(NullableInts)); + _nullableInts.CollectionChanged -= handler; } _nullableInts = value; this.RaisePropertyChanged(nameof(NullableInts)); - if (_nullableInts != null) + if (value != null) { - // Remove the old handler if it exists - NullableInts.CollectionChanged -= CollectionChanged(this, nameof(NullableInts)); - - NullableInts.CollectionChanged += CollectionChanged(this, nameof(NullableInts)); + value.CollectionChanged += handler; } } } - - [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 +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Record#RxCollAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Record#RxCollAttr.verified.cs new file mode 100644 index 00000000..4bef164c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Record#RxCollAttr.verified.cs @@ -0,0 +1,19 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs +// Copyright (c) 2026 .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/RxCollExtTests.Record#TestNs.TestVMRecord.ReactiveCollections.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Record#TestNs.TestVMRecord.RxColls.verified.cs similarity index 51% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Record#TestNs.TestVMRecord.ReactiveCollections.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Record#TestNs.TestVMRecord.RxColls.verified.cs index b3f5e61a..3d823a28 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Record#TestNs.TestVMRecord.ReactiveCollections.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Record#TestNs.TestVMRecord.RxColls.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVMRecord.ReactiveCollections.g.cs +//HintName: TestNs.TestVMRecord.ReactiveCollections.g.cs // using ReactiveUI; @@ -6,9 +6,10 @@ #nullable enable namespace TestNs { - public partial record TestVMRecord { + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _numbersCollectionChangedHandler; + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Collections.ObjectModel.ObservableCollection? Numbers @@ -16,23 +17,24 @@ public partial record TestVMRecord get => _numbers; set { - if (value == null) + var handler = _numbersCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(Numbers)); + if (_numbers != null) { - Numbers.CollectionChanged -= CollectionChanged(this, nameof(Numbers)); + _numbers.CollectionChanged -= handler; } _numbers = value; this.RaisePropertyChanged(nameof(Numbers)); - if (_numbers != null) + if (value != null) { - // Remove the old handler if it exists - Numbers.CollectionChanged -= CollectionChanged(this, nameof(Numbers)); - - Numbers.CollectionChanged += CollectionChanged(this, nameof(Numbers)); + value.CollectionChanged += handler; } } } + + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _namesCollectionChangedHandler; + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Collections.ObjectModel.ObservableCollection? Names @@ -40,27 +42,22 @@ public partial record TestVMRecord get => _names; set { - if (value == null) + var handler = _namesCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(Names)); + if (_names != null) { - Names.CollectionChanged -= CollectionChanged(this, nameof(Names)); + _names.CollectionChanged -= handler; } _names = value; this.RaisePropertyChanged(nameof(Names)); - if (_names != null) + if (value != null) { - // Remove the old handler if it exists - Names.CollectionChanged -= CollectionChanged(this, nameof(Names)); - - Names.CollectionChanged += CollectionChanged(this, nameof(Names)); + value.CollectionChanged += handler; } } } - - [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 +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Struct#RxCollAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Struct#RxCollAttr.verified.cs new file mode 100644 index 00000000..4bef164c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Struct#RxCollAttr.verified.cs @@ -0,0 +1,19 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs +// Copyright (c) 2026 .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/RCE.Struct#TestNs.TestVM.RxColls.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Struct#TestNs.TestVM.RxColls.verified.cs new file mode 100644 index 00000000..3110898e --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Struct#TestNs.TestVM.RxColls.verified.cs @@ -0,0 +1,38 @@ +//HintName: TestNs.TestVM.ReactiveCollections.g.cs +// +using ReactiveUI; + +#pragma warning disable +#nullable enable +namespace TestNs +{ + public partial class TestVM + { + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _pointsCollectionChangedHandler; + + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public global::System.Collections.ObjectModel.ObservableCollection? Points + { + get => _points; + set + { + var handler = _pointsCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(Points)); + if (_points != null) + { + _points.CollectionChanged -= handler; + } + + _points = value; + this.RaisePropertyChanged(nameof(Points)); + + if (value != null) + { + value.CollectionChanged += handler; + } + } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Tuple#RxCollAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Tuple#RxCollAttr.verified.cs new file mode 100644 index 00000000..4bef164c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Tuple#RxCollAttr.verified.cs @@ -0,0 +1,19 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs +// Copyright (c) 2026 .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/RCE.Tuple#TestNs.TestVM.RxColls.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Tuple#TestNs.TestVM.RxColls.verified.cs new file mode 100644 index 00000000..e222f0b6 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.Tuple#TestNs.TestVM.RxColls.verified.cs @@ -0,0 +1,38 @@ +//HintName: TestNs.TestVM.ReactiveCollections.g.cs +// +using ReactiveUI; + +#pragma warning disable +#nullable enable +namespace TestNs +{ + public partial class TestVM + { + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _tuplesCollectionChangedHandler; + + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public global::System.Collections.ObjectModel.ObservableCollection<(int Id, string Name)>? Tuples + { + get => _tuples; + set + { + var handler = _tuplesCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(Tuples)); + if (_tuples != null) + { + _tuples.CollectionChanged -= handler; + } + + _tuples = value; + this.RaisePropertyChanged(nameof(Tuples)); + + if (value != null) + { + value.CollectionChanged += handler; + } + } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.WRx#RxCollAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.WRx#RxCollAttr.verified.cs new file mode 100644 index 00000000..4bef164c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.WRx#RxCollAttr.verified.cs @@ -0,0 +1,19 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs +// Copyright (c) 2026 .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/RxCollExtTests.WithReactive#TestNs.TestVM.ReactiveCollections.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.WRx#TestNs.TestVM.RxColls.verified.cs similarity index 51% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.WithReactive#TestNs.TestVM.ReactiveCollections.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.WRx#TestNs.TestVM.RxColls.verified.cs index 6b7f5f58..d058336e 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.WithReactive#TestNs.TestVM.ReactiveCollections.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCE.WRx#TestNs.TestVM.RxColls.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.ReactiveCollections.g.cs +//HintName: TestNs.TestVM.ReactiveCollections.g.cs // using ReactiveUI; @@ -6,9 +6,10 @@ #nullable enable namespace TestNs { - public partial class TestVM { + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _itemsCollectionChangedHandler; + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Collections.ObjectModel.ObservableCollection? Items @@ -16,23 +17,24 @@ public partial class TestVM get => _items; set { - if (value == null) + var handler = _itemsCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(Items)); + if (_items != null) { - Items.CollectionChanged -= CollectionChanged(this, nameof(Items)); + _items.CollectionChanged -= handler; } _items = value; this.RaisePropertyChanged(nameof(Items)); - if (_items != null) + if (value != null) { - // Remove the old handler if it exists - Items.CollectionChanged -= CollectionChanged(this, nameof(Items)); - - Items.CollectionChanged += CollectionChanged(this, nameof(Items)); + value.CollectionChanged += handler; } } } + + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _selectedIdsCollectionChangedHandler; + /// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public global::System.Collections.ObjectModel.ObservableCollection? SelectedIds @@ -40,27 +42,22 @@ public partial class TestVM get => _selectedIds; set { - if (value == null) + var handler = _selectedIdsCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(SelectedIds)); + if (_selectedIds != null) { - SelectedIds.CollectionChanged -= CollectionChanged(this, nameof(SelectedIds)); + _selectedIds.CollectionChanged -= handler; } _selectedIds = value; this.RaisePropertyChanged(nameof(SelectedIds)); - if (_selectedIds != null) + if (value != null) { - // Remove the old handler if it exists - SelectedIds.CollectionChanged -= CollectionChanged(this, nameof(SelectedIds)); - - SelectedIds.CollectionChanged += CollectionChanged(this, nameof(SelectedIds)); + value.CollectionChanged += handler; } } } - - [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 +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCG.BasicField#RxCollAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCG.BasicField#RxCollAttr.verified.cs new file mode 100644 index 00000000..4bef164c --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCG.BasicField#RxCollAttr.verified.cs @@ -0,0 +1,19 @@ +//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs +// Copyright (c) 2026 .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/RCG.BasicField#TestNs.TestVM.RxColls.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCG.BasicField#TestNs.TestVM.RxColls.verified.cs new file mode 100644 index 00000000..75fd3494 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RCG.BasicField#TestNs.TestVM.RxColls.verified.cs @@ -0,0 +1,38 @@ +//HintName: TestNs.TestVM.ReactiveCollections.g.cs +// +using ReactiveUI; + +#pragma warning disable +#nullable enable +namespace TestNs +{ + public partial class TestVM + { + private global::System.Collections.Specialized.NotifyCollectionChangedEventHandler? _publicObservableCollectionTestCollectionChangedHandler; + + /// + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + public global::System.Collections.ObjectModel.ObservableCollection? PublicObservableCollectionTest + { + get => _publicObservableCollectionTest; + set + { + var handler = _publicObservableCollectionTestCollectionChangedHandler ??= (_, _) => this.RaisePropertyChanged(nameof(PublicObservableCollectionTest)); + if (_publicObservableCollectionTest != null) + { + _publicObservableCollectionTest.CollectionChanged -= handler; + } + + _publicObservableCollectionTest = value; + this.RaisePropertyChanged(nameof(PublicObservableCollectionTest)); + + if (value != null) + { + value.CollectionChanged += handler; + } + } + } + } +} +#nullable restore +#pragma warning restore diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/ReactiveCollectionGeneratorTests.BasicField#TestNs.TestVM.ReactiveCollections.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/ReactiveCollectionGeneratorTests.BasicField#TestNs.TestVM.ReactiveCollections.g.verified.cs deleted file mode 100644 index 52dbc418..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/ReactiveCollectionGeneratorTests.BasicField#TestNs.TestVM.ReactiveCollections.g.verified.cs +++ /dev/null @@ -1,42 +0,0 @@ -//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/REACTIVECOLL/RxCollExtTests.ByteArray#TestNs.TestVM.ReactiveCollections.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.ByteArray#TestNs.TestVM.ReactiveCollections.g.verified.cs deleted file mode 100644 index fb69f668..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.ByteArray#TestNs.TestVM.ReactiveCollections.g.verified.cs +++ /dev/null @@ -1,42 +0,0 @@ -//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? BinaryData - { - get => _binaryData; - set - { - if (value == null) - { - BinaryData.CollectionChanged -= CollectionChanged(this, nameof(BinaryData)); - } - - _binaryData = value; - this.RaisePropertyChanged(nameof(BinaryData)); - - if (_binaryData != null) - { - // Remove the old handler if it exists - BinaryData.CollectionChanged -= CollectionChanged(this, nameof(BinaryData)); - - BinaryData.CollectionChanged += CollectionChanged(this, nameof(BinaryData)); - } - } - } - - [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/REACTIVECOLL/RxCollExtTests.ComplexType#TestNs.TestVM.ReactiveCollections.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.ComplexType#TestNs.TestVM.ReactiveCollections.g.verified.cs deleted file mode 100644 index 5b8d9e77..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.ComplexType#TestNs.TestVM.ReactiveCollections.g.verified.cs +++ /dev/null @@ -1,42 +0,0 @@ -//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? Items - { - get => _items; - set - { - if (value == null) - { - Items.CollectionChanged -= CollectionChanged(this, nameof(Items)); - } - - _items = value; - this.RaisePropertyChanged(nameof(Items)); - - if (_items != null) - { - // Remove the old handler if it exists - Items.CollectionChanged -= CollectionChanged(this, nameof(Items)); - - Items.CollectionChanged += CollectionChanged(this, nameof(Items)); - } - } - } - - [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/REACTIVECOLL/RxCollExtTests.DiffNs#Namespace1.TestVM.ReactiveCollections.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.DiffNs#Namespace1.TestVM.ReactiveCollections.g.verified.cs deleted file mode 100644 index 8c346c16..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.DiffNs#Namespace1.TestVM.ReactiveCollections.g.verified.cs +++ /dev/null @@ -1,42 +0,0 @@ -//HintName: Namespace1.TestVM.ReactiveCollections.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable -namespace Namespace1 -{ - - public partial class TestVM - { - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::System.Collections.ObjectModel.ObservableCollection? Numbers - { - get => _numbers; - set - { - if (value == null) - { - Numbers.CollectionChanged -= CollectionChanged(this, nameof(Numbers)); - } - - _numbers = value; - this.RaisePropertyChanged(nameof(Numbers)); - - if (_numbers != null) - { - // Remove the old handler if it exists - Numbers.CollectionChanged -= CollectionChanged(this, nameof(Numbers)); - - Numbers.CollectionChanged += CollectionChanged(this, nameof(Numbers)); - } - } - } - - [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/REACTIVECOLL/RxCollExtTests.DiffNs#Namespace2.TestVM.ReactiveCollections.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.DiffNs#Namespace2.TestVM.ReactiveCollections.g.verified.cs deleted file mode 100644 index a5322851..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.DiffNs#Namespace2.TestVM.ReactiveCollections.g.verified.cs +++ /dev/null @@ -1,42 +0,0 @@ -//HintName: Namespace2.TestVM.ReactiveCollections.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable -namespace Namespace2 -{ - - public partial class TestVM - { - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::System.Collections.ObjectModel.ObservableCollection? Names - { - get => _names; - set - { - if (value == null) - { - Names.CollectionChanged -= CollectionChanged(this, nameof(Names)); - } - - _names = value; - this.RaisePropertyChanged(nameof(Names)); - - if (_names != null) - { - // Remove the old handler if it exists - Names.CollectionChanged -= CollectionChanged(this, nameof(Names)); - - Names.CollectionChanged += CollectionChanged(this, nameof(Names)); - } - } - } - - [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/REACTIVECOLL/RxCollExtTests.DiffNs#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.DiffNs#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs deleted file mode 100644 index 89bb3391..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.DiffNs#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs -// Copyright (c) 2026 .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/RxCollExtTests.Enum#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Enum#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs deleted file mode 100644 index 89bb3391..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Enum#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs -// Copyright (c) 2026 .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/RxCollExtTests.Enum#TestNs.TestVM.ReactiveCollections.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Enum#TestNs.TestVM.ReactiveCollections.g.verified.cs deleted file mode 100644 index 4d09aae3..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Enum#TestNs.TestVM.ReactiveCollections.g.verified.cs +++ /dev/null @@ -1,42 +0,0 @@ -//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? Statuses - { - get => _statuses; - set - { - if (value == null) - { - Statuses.CollectionChanged -= CollectionChanged(this, nameof(Statuses)); - } - - _statuses = value; - this.RaisePropertyChanged(nameof(Statuses)); - - if (_statuses != null) - { - // Remove the old handler if it exists - Statuses.CollectionChanged -= CollectionChanged(this, nameof(Statuses)); - - Statuses.CollectionChanged += CollectionChanged(this, nameof(Statuses)); - } - } - } - - [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/REACTIVECOLL/RxCollExtTests.Generic#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Generic#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs deleted file mode 100644 index 89bb3391..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Generic#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs -// Copyright (c) 2026 .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/RxCollExtTests.Generic#TestNs.GenericVM`1.ReactiveCollections.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Generic#TestNs.GenericVM`1.ReactiveCollections.g.verified.cs deleted file mode 100644 index f8c9330a..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Generic#TestNs.GenericVM`1.ReactiveCollections.g.verified.cs +++ /dev/null @@ -1,42 +0,0 @@ -//HintName: TestNs.GenericVM`1.ReactiveCollections.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable -namespace TestNs -{ - - public partial class GenericVM - { - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::System.Collections.ObjectModel.ObservableCollection? Items - { - get => _items; - set - { - if (value == null) - { - Items.CollectionChanged -= CollectionChanged(this, nameof(Items)); - } - - _items = value; - this.RaisePropertyChanged(nameof(Items)); - - if (_items != null) - { - // Remove the old handler if it exists - Items.CollectionChanged -= CollectionChanged(this, nameof(Items)); - - Items.CollectionChanged += CollectionChanged(this, nameof(Items)); - } - } - } - - [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/REACTIVECOLL/RxCollExtTests.Guid#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Guid#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs deleted file mode 100644 index 89bb3391..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Guid#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs -// Copyright (c) 2026 .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/RxCollExtTests.Guid#TestNs.TestVM.ReactiveCollections.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Guid#TestNs.TestVM.ReactiveCollections.g.verified.cs deleted file mode 100644 index 31ee6c89..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Guid#TestNs.TestVM.ReactiveCollections.g.verified.cs +++ /dev/null @@ -1,42 +0,0 @@ -//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? Ids - { - get => _ids; - set - { - if (value == null) - { - Ids.CollectionChanged -= CollectionChanged(this, nameof(Ids)); - } - - _ids = value; - this.RaisePropertyChanged(nameof(Ids)); - - if (_ids != null) - { - // Remove the old handler if it exists - Ids.CollectionChanged -= CollectionChanged(this, nameof(Ids)); - - Ids.CollectionChanged += CollectionChanged(this, nameof(Ids)); - } - } - } - - [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/REACTIVECOLL/RxCollExtTests.Interface#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Interface#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs deleted file mode 100644 index 89bb3391..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Interface#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs -// Copyright (c) 2026 .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/RxCollExtTests.Multiple#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Multiple#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs deleted file mode 100644 index 89bb3391..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Multiple#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs -// Copyright (c) 2026 .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/RxCollExtTests.Nested#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Nested#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs deleted file mode 100644 index 89bb3391..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Nested#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs -// Copyright (c) 2026 .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/RxCollExtTests.Nested#TestNs.OuterVM+InnerVM+DeepInnerVM.ReactiveCollections.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Nested#TestNs.OuterVM+InnerVM+DeepInnerVM.ReactiveCollections.g.verified.cs deleted file mode 100644 index 8ab4a46b..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Nested#TestNs.OuterVM+InnerVM+DeepInnerVM.ReactiveCollections.g.verified.cs +++ /dev/null @@ -1,49 +0,0 @@ -//HintName: TestNs.OuterVM+InnerVM+DeepInnerVM.ReactiveCollections.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable -namespace TestNs -{ - public partial class OuterVM -{ -public partial class InnerVM -{ - - public partial class DeepInnerVM - { - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::System.Collections.ObjectModel.ObservableCollection? DeepCollection - { - get => _deepCollection; - set - { - if (value == null) - { - DeepCollection.CollectionChanged -= CollectionChanged(this, nameof(DeepCollection)); - } - - _deepCollection = value; - this.RaisePropertyChanged(nameof(DeepCollection)); - - if (_deepCollection != null) - { - // Remove the old handler if it exists - DeepCollection.CollectionChanged -= CollectionChanged(this, nameof(DeepCollection)); - - DeepCollection.CollectionChanged += CollectionChanged(this, nameof(DeepCollection)); - } - } - } - - [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/REACTIVECOLL/RxCollExtTests.Nested#TestNs.OuterVM+InnerVM.ReactiveCollections.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Nested#TestNs.OuterVM+InnerVM.ReactiveCollections.g.verified.cs deleted file mode 100644 index fac04909..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Nested#TestNs.OuterVM+InnerVM.ReactiveCollections.g.verified.cs +++ /dev/null @@ -1,46 +0,0 @@ -//HintName: TestNs.OuterVM+InnerVM.ReactiveCollections.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable -namespace TestNs -{ - public partial class OuterVM -{ - - public partial class InnerVM - { - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::System.Collections.ObjectModel.ObservableCollection? InnerCollection - { - get => _innerCollection; - set - { - if (value == null) - { - InnerCollection.CollectionChanged -= CollectionChanged(this, nameof(InnerCollection)); - } - - _innerCollection = value; - this.RaisePropertyChanged(nameof(InnerCollection)); - - if (_innerCollection != null) - { - // Remove the old handler if it exists - InnerCollection.CollectionChanged -= CollectionChanged(this, nameof(InnerCollection)); - - InnerCollection.CollectionChanged += CollectionChanged(this, nameof(InnerCollection)); - } - } - } - - [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/REACTIVECOLL/RxCollExtTests.Nested#TestNs.OuterVM.ReactiveCollections.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Nested#TestNs.OuterVM.ReactiveCollections.g.verified.cs deleted file mode 100644 index 212c810d..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Nested#TestNs.OuterVM.ReactiveCollections.g.verified.cs +++ /dev/null @@ -1,42 +0,0 @@ -//HintName: TestNs.OuterVM.ReactiveCollections.g.cs -// -using ReactiveUI; - -#pragma warning disable -#nullable enable -namespace TestNs -{ - - public partial class OuterVM - { - /// - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - public global::System.Collections.ObjectModel.ObservableCollection? OuterCollection - { - get => _outerCollection; - set - { - if (value == null) - { - OuterCollection.CollectionChanged -= CollectionChanged(this, nameof(OuterCollection)); - } - - _outerCollection = value; - this.RaisePropertyChanged(nameof(OuterCollection)); - - if (_outerCollection != null) - { - // Remove the old handler if it exists - OuterCollection.CollectionChanged -= CollectionChanged(this, nameof(OuterCollection)); - - OuterCollection.CollectionChanged += CollectionChanged(this, nameof(OuterCollection)); - } - } - } - - [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/REACTIVECOLL/RxCollExtTests.Nullable#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Nullable#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs deleted file mode 100644 index 89bb3391..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Nullable#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs -// Copyright (c) 2026 .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/RxCollExtTests.Record#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Record#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs deleted file mode 100644 index 89bb3391..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Record#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs -// Copyright (c) 2026 .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/RxCollExtTests.Struct#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Struct#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs deleted file mode 100644 index 89bb3391..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Struct#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs -// Copyright (c) 2026 .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/RxCollExtTests.Struct#TestNs.TestVM.ReactiveCollections.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Struct#TestNs.TestVM.ReactiveCollections.g.verified.cs deleted file mode 100644 index a7ee5a8b..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Struct#TestNs.TestVM.ReactiveCollections.g.verified.cs +++ /dev/null @@ -1,42 +0,0 @@ -//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? Points - { - get => _points; - set - { - if (value == null) - { - Points.CollectionChanged -= CollectionChanged(this, nameof(Points)); - } - - _points = value; - this.RaisePropertyChanged(nameof(Points)); - - if (_points != null) - { - // Remove the old handler if it exists - Points.CollectionChanged -= CollectionChanged(this, nameof(Points)); - - Points.CollectionChanged += CollectionChanged(this, nameof(Points)); - } - } - } - - [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/REACTIVECOLL/RxCollExtTests.Tuple#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Tuple#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs deleted file mode 100644 index 89bb3391..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Tuple#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs -// Copyright (c) 2026 .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/RxCollExtTests.Tuple#TestNs.TestVM.ReactiveCollections.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Tuple#TestNs.TestVM.ReactiveCollections.g.verified.cs deleted file mode 100644 index 244d9f41..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.Tuple#TestNs.TestVM.ReactiveCollections.g.verified.cs +++ /dev/null @@ -1,42 +0,0 @@ -//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<(int Id, string Name)>? Tuples - { - get => _tuples; - set - { - if (value == null) - { - Tuples.CollectionChanged -= CollectionChanged(this, nameof(Tuples)); - } - - _tuples = value; - this.RaisePropertyChanged(nameof(Tuples)); - - if (_tuples != null) - { - // Remove the old handler if it exists - Tuples.CollectionChanged -= CollectionChanged(this, nameof(Tuples)); - - Tuples.CollectionChanged += CollectionChanged(this, nameof(Tuples)); - } - } - } - - [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/REACTIVECOLL/RxCollExtTests.WithReactive#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.WithReactive#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs deleted file mode 100644 index 89bb3391..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVECOLL/RxCollExtTests.WithReactive#ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs -// Copyright (c) 2026 .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/REACTIVEOBJ/ReactiveObjectGeneratorTests.Basic#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.Basic#IRxObjAttr.verified.cs similarity index 90% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ReactiveObjectGeneratorTests.Basic#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.Basic#IRxObjAttr.verified.cs index 159a4426..fa7282c7 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ReactiveObjectGeneratorTests.Basic#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.Basic#IRxObjAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs // Copyright (c) 2026 .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. diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ReactiveObjectGeneratorTests.Basic#TestNs.TestVM.IReactiveObject.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.Basic#TestNs.TestVM.IRxObj.verified.cs similarity index 97% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ReactiveObjectGeneratorTests.Basic#TestNs.TestVM.IReactiveObject.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.Basic#TestNs.TestVM.IRxObj.verified.cs index cb482d41..69a07712 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ReactiveObjectGeneratorTests.Basic#TestNs.TestVM.IReactiveObject.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.Basic#TestNs.TestVM.IRxObj.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.IReactiveObject.g.cs +//HintName: TestNs.TestVM.IReactiveObject.g.cs // #pragma warning disable #nullable enable diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.Basic#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.CplxT#IRxObjAttr.verified.cs similarity index 90% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.Basic#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.CplxT#IRxObjAttr.verified.cs index 159a4426..fa7282c7 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.Basic#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.CplxT#IRxObjAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs // Copyright (c) 2026 .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. diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.ComplexType#TestNs.TestVM.IReactiveObject.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.CplxT#TestNs.TestVM.IRxObj.verified.cs similarity index 97% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.ComplexType#TestNs.TestVM.IReactiveObject.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.CplxT#TestNs.TestVM.IRxObj.verified.cs index cb482d41..69a07712 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.ComplexType#TestNs.TestVM.IReactiveObject.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.CplxT#TestNs.TestVM.IRxObj.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.IReactiveObject.g.cs +//HintName: TestNs.TestVM.IReactiveObject.g.cs // #pragma warning disable #nullable enable diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.ComplexType#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.Enums#IRxObjAttr.verified.cs similarity index 90% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.ComplexType#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.Enums#IRxObjAttr.verified.cs index 159a4426..fa7282c7 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.ComplexType#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.Enums#IRxObjAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs // Copyright (c) 2026 .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. diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.Enums#TestNs.TestVM.IReactiveObject.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.Enums#TestNs.TestVM.IRxObj.verified.cs similarity index 97% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.Enums#TestNs.TestVM.IReactiveObject.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.Enums#TestNs.TestVM.IRxObj.verified.cs index cb482d41..69a07712 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.Enums#TestNs.TestVM.IReactiveObject.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.Enums#TestNs.TestVM.IRxObj.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.IReactiveObject.g.cs +//HintName: TestNs.TestVM.IReactiveObject.g.cs // #pragma warning disable #nullable enable diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.Enums#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjRecord#IRxObjAttr.verified.cs similarity index 90% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.Enums#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjRecord#IRxObjAttr.verified.cs index 159a4426..fa7282c7 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.Enums#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjRecord#IRxObjAttr.verified.cs @@ -1,4 +1,4 @@ -//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs +//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs // Copyright (c) 2026 .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. diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWAccMods#IRxObjAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWAccMods#IRxObjAttr.verified.cs new file mode 100644 index 00000000..fa7282c7 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWAccMods#IRxObjAttr.verified.cs @@ -0,0 +1,19 @@ +//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// IReactiveObject Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] +internal sealed class IReactiveObjectAttribute : global::System.Attribute; +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.Basic#TestNs.TestVM.IReactiveObject.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWAccMods#TestNs.TestVM.IRxObj.verified.cs similarity index 97% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.Basic#TestNs.TestVM.IReactiveObject.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWAccMods#TestNs.TestVM.IRxObj.verified.cs index cb482d41..69a07712 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.Basic#TestNs.TestVM.IReactiveObject.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWAccMods#TestNs.TestVM.IRxObj.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.TestVM.IReactiveObject.g.cs +//HintName: TestNs.TestVM.IReactiveObject.g.cs // #pragma warning disable #nullable enable diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWAttrs#IRxObjAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWAttrs#IRxObjAttr.verified.cs new file mode 100644 index 00000000..fa7282c7 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWAttrs#IRxObjAttr.verified.cs @@ -0,0 +1,19 @@ +//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// IReactiveObject Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] +internal sealed class IReactiveObjectAttribute : global::System.Attribute; +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWAttrs#TestNs.TestVM.IRxObj.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWAttrs#TestNs.TestVM.IRxObj.verified.cs new file mode 100644 index 00000000..69a07712 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWAttrs#TestNs.TestVM.IRxObj.verified.cs @@ -0,0 +1,68 @@ +//HintName: TestNs.TestVM.IReactiveObject.g.cs +// +#pragma warning disable +#nullable enable +using System; +using System.Diagnostics.CodeAnalysis; +using System.ComponentModel; +using ReactiveUI; + +namespace TestNs +{ + /// + /// Partial class for the TestVM which contains ReactiveUI IReactiveObject initialization. + /// + public partial class TestVM : IReactiveObject + { + private bool _propertyChangingEventsSubscribed; + private bool _propertyChangedEventsSubscribed; + + /// + public event PropertyChangingEventHandler? PropertyChanging + { + add + { + if (!_propertyChangingEventsSubscribed) + { + this.SubscribePropertyChangingEvents(); + _propertyChangingEventsSubscribed = true; + } + + PropertyChangingHandler += value; + } + remove => PropertyChangingHandler -= value; + } + + /// + public event PropertyChangedEventHandler? PropertyChanged + { + add + { + if (!_propertyChangedEventsSubscribed) + { + this.SubscribePropertyChangedEvents(); + _propertyChangedEventsSubscribed = true; + } + + PropertyChangedHandler += value; + } + remove => PropertyChangedHandler -= value; + } + + [SuppressMessage("Roslynator", "RCS1159:Use EventHandler", Justification = "Long term design.")] + private event PropertyChangingEventHandler? PropertyChangingHandler; + + [SuppressMessage("Roslynator", "RCS1159:Use EventHandler", Justification = "Long term design.")] + private event PropertyChangedEventHandler? PropertyChangedHandler; + + /// + void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) => + PropertyChangingHandler?.Invoke(this, args); + + /// + void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) => + PropertyChangedHandler?.Invoke(this, args); + } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWDeeplyNestClasses#IRxObjAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWDeeplyNestClasses#IRxObjAttr.verified.cs new file mode 100644 index 00000000..fa7282c7 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWDeeplyNestClasses#IRxObjAttr.verified.cs @@ -0,0 +1,19 @@ +//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// IReactiveObject Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] +internal sealed class IReactiveObjectAttribute : global::System.Attribute; +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithDeeplyNestedClasses#TestNs.Level1+Level2+Level3+Level4.IReactiveObject.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWDeeplyNestClasses#TestNs.Level1+Level2+Level3+Level4.IRxObj.verified.cs similarity index 96% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithDeeplyNestedClasses#TestNs.Level1+Level2+Level3+Level4.IReactiveObject.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWDeeplyNestClasses#TestNs.Level1+Level2+Level3+Level4.IRxObj.verified.cs index 667c2120..595edd9d 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithDeeplyNestedClasses#TestNs.Level1+Level2+Level3+Level4.IReactiveObject.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWDeeplyNestClasses#TestNs.Level1+Level2+Level3+Level4.IRxObj.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.Level1+Level2+Level3+Level4.IReactiveObject.g.cs +//HintName: TestNs.Level1+Level2+Level3+Level4.IReactiveObject.g.cs // #pragma warning disable #nullable enable diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithDeeplyNestedClasses#TestNs.Level1+Level2+Level3.IReactiveObject.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWDeeplyNestClasses#TestNs.Level1+Level2+Level3.IRxObj.verified.cs similarity index 97% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithDeeplyNestedClasses#TestNs.Level1+Level2+Level3.IReactiveObject.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWDeeplyNestClasses#TestNs.Level1+Level2+Level3.IRxObj.verified.cs index bea1ef9a..58e1f8ad 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithDeeplyNestedClasses#TestNs.Level1+Level2+Level3.IReactiveObject.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWDeeplyNestClasses#TestNs.Level1+Level2+Level3.IRxObj.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.Level1+Level2+Level3.IReactiveObject.g.cs +//HintName: TestNs.Level1+Level2+Level3.IReactiveObject.g.cs // #pragma warning disable #nullable enable diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithDeeplyNestedClasses#TestNs.Level1+Level2.IReactiveObject.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWDeeplyNestClasses#TestNs.Level1+Level2.IRxObj.verified.cs similarity index 97% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithDeeplyNestedClasses#TestNs.Level1+Level2.IReactiveObject.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWDeeplyNestClasses#TestNs.Level1+Level2.IRxObj.verified.cs index bcdbfdba..3aae082f 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithDeeplyNestedClasses#TestNs.Level1+Level2.IReactiveObject.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWDeeplyNestClasses#TestNs.Level1+Level2.IRxObj.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.Level1+Level2.IReactiveObject.g.cs +//HintName: TestNs.Level1+Level2.IReactiveObject.g.cs // #pragma warning disable #nullable enable diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithDeeplyNestedClasses#TestNs.Level1.IReactiveObject.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWDeeplyNestClasses#TestNs.Level1.IRxObj.verified.cs similarity index 97% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithDeeplyNestedClasses#TestNs.Level1.IReactiveObject.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWDeeplyNestClasses#TestNs.Level1.IRxObj.verified.cs index e362f538..957d1572 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithDeeplyNestedClasses#TestNs.Level1.IReactiveObject.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWDeeplyNestClasses#TestNs.Level1.IRxObj.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.Level1.IReactiveObject.g.cs +//HintName: TestNs.Level1.IReactiveObject.g.cs // #pragma warning disable #nullable enable diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWGenClass#IRxObjAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWGenClass#IRxObjAttr.verified.cs new file mode 100644 index 00000000..fa7282c7 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWGenClass#IRxObjAttr.verified.cs @@ -0,0 +1,19 @@ +//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// IReactiveObject Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] +internal sealed class IReactiveObjectAttribute : global::System.Attribute; +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithGenericClass#TestNs.GenericVM`1.IReactiveObject.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWGenClass#TestNs.GenVM`1.IRxObj.verified.cs similarity index 97% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithGenericClass#TestNs.GenericVM`1.IReactiveObject.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWGenClass#TestNs.GenVM`1.IRxObj.verified.cs index 076014b8..cf3eefc5 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithGenericClass#TestNs.GenericVM`1.IReactiveObject.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWGenClass#TestNs.GenVM`1.IRxObj.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.GenericVM`1.IReactiveObject.g.cs +//HintName: TestNs.GenericVM`1.IReactiveObject.g.cs // #pragma warning disable #nullable enable diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWInhMods#IRxObjAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWInhMods#IRxObjAttr.verified.cs new file mode 100644 index 00000000..fa7282c7 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWInhMods#IRxObjAttr.verified.cs @@ -0,0 +1,19 @@ +//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// IReactiveObject Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] +internal sealed class IReactiveObjectAttribute : global::System.Attribute; +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithInheritanceModifiers#TestNs.BaseVM.IReactiveObject.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWInhMods#TestNs.BaseVM.IRxObj.verified.cs similarity index 97% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithInheritanceModifiers#TestNs.BaseVM.IReactiveObject.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWInhMods#TestNs.BaseVM.IRxObj.verified.cs index 11075291..488842e4 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithInheritanceModifiers#TestNs.BaseVM.IReactiveObject.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWInhMods#TestNs.BaseVM.IRxObj.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.BaseVM.IReactiveObject.g.cs +//HintName: TestNs.BaseVM.IReactiveObject.g.cs // #pragma warning disable #nullable enable diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithInheritanceModifiers#TestNs.DerivedVM.IReactiveObject.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWInhMods#TestNs.DerivedVM.IRxObj.verified.cs similarity index 97% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithInheritanceModifiers#TestNs.DerivedVM.IReactiveObject.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWInhMods#TestNs.DerivedVM.IRxObj.verified.cs index b2dc952c..40bcd28b 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithInheritanceModifiers#TestNs.DerivedVM.IReactiveObject.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWInhMods#TestNs.DerivedVM.IRxObj.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.DerivedVM.IReactiveObject.g.cs +//HintName: TestNs.DerivedVM.IReactiveObject.g.cs // #pragma warning disable #nullable enable diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWMultiProps#IRxObjAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWMultiProps#IRxObjAttr.verified.cs new file mode 100644 index 00000000..fa7282c7 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWMultiProps#IRxObjAttr.verified.cs @@ -0,0 +1,19 @@ +//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// IReactiveObject Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] +internal sealed class IReactiveObjectAttribute : global::System.Attribute; +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWMultiProps#TestNs.TestVM.IRxObj.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWMultiProps#TestNs.TestVM.IRxObj.verified.cs new file mode 100644 index 00000000..69a07712 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWMultiProps#TestNs.TestVM.IRxObj.verified.cs @@ -0,0 +1,68 @@ +//HintName: TestNs.TestVM.IReactiveObject.g.cs +// +#pragma warning disable +#nullable enable +using System; +using System.Diagnostics.CodeAnalysis; +using System.ComponentModel; +using ReactiveUI; + +namespace TestNs +{ + /// + /// Partial class for the TestVM which contains ReactiveUI IReactiveObject initialization. + /// + public partial class TestVM : IReactiveObject + { + private bool _propertyChangingEventsSubscribed; + private bool _propertyChangedEventsSubscribed; + + /// + public event PropertyChangingEventHandler? PropertyChanging + { + add + { + if (!_propertyChangingEventsSubscribed) + { + this.SubscribePropertyChangingEvents(); + _propertyChangingEventsSubscribed = true; + } + + PropertyChangingHandler += value; + } + remove => PropertyChangingHandler -= value; + } + + /// + public event PropertyChangedEventHandler? PropertyChanged + { + add + { + if (!_propertyChangedEventsSubscribed) + { + this.SubscribePropertyChangedEvents(); + _propertyChangedEventsSubscribed = true; + } + + PropertyChangedHandler += value; + } + remove => PropertyChangedHandler -= value; + } + + [SuppressMessage("Roslynator", "RCS1159:Use EventHandler", Justification = "Long term design.")] + private event PropertyChangingEventHandler? PropertyChangingHandler; + + [SuppressMessage("Roslynator", "RCS1159:Use EventHandler", Justification = "Long term design.")] + private event PropertyChangedEventHandler? PropertyChangedHandler; + + /// + void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) => + PropertyChangingHandler?.Invoke(this, args); + + /// + void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) => + PropertyChangedHandler?.Invoke(this, args); + } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWMultiTConstraints#IRxObjAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWMultiTConstraints#IRxObjAttr.verified.cs new file mode 100644 index 00000000..fa7282c7 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWMultiTConstraints#IRxObjAttr.verified.cs @@ -0,0 +1,19 @@ +//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// IReactiveObject Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] +internal sealed class IReactiveObjectAttribute : global::System.Attribute; +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithMultipleTypeConstraints#TestNs.EntityVM`1.IReactiveObject.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWMultiTConstraints#TestNs.EntityVM`1.IRxObj.verified.cs similarity index 97% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithMultipleTypeConstraints#TestNs.EntityVM`1.IReactiveObject.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWMultiTConstraints#TestNs.EntityVM`1.IRxObj.verified.cs index 11a8e664..f1e45eb2 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithMultipleTypeConstraints#TestNs.EntityVM`1.IReactiveObject.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWMultiTConstraints#TestNs.EntityVM`1.IRxObj.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.EntityVM`1.IReactiveObject.g.cs +//HintName: TestNs.EntityVM`1.IReactiveObject.g.cs // #pragma warning disable #nullable enable diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWNestClass#IRxObjAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWNestClass#IRxObjAttr.verified.cs new file mode 100644 index 00000000..fa7282c7 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWNestClass#IRxObjAttr.verified.cs @@ -0,0 +1,19 @@ +//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// IReactiveObject Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] +internal sealed class IReactiveObjectAttribute : global::System.Attribute; +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithNestedClass#TestNs.ParentVM+ChildVM.IReactiveObject.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWNestClass#TestNs.ParentVM+ChildVM.IRxObj.verified.cs similarity index 97% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithNestedClass#TestNs.ParentVM+ChildVM.IReactiveObject.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWNestClass#TestNs.ParentVM+ChildVM.IRxObj.verified.cs index 6b2e376e..ac322e8c 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithNestedClass#TestNs.ParentVM+ChildVM.IReactiveObject.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWNestClass#TestNs.ParentVM+ChildVM.IRxObj.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.ParentVM+ChildVM.IReactiveObject.g.cs +//HintName: TestNs.ParentVM+ChildVM.IReactiveObject.g.cs // #pragma warning disable #nullable enable diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithNestedClass#TestNs.ParentVM.IReactiveObject.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWNestClass#TestNs.ParentVM.IRxObj.verified.cs similarity index 97% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithNestedClass#TestNs.ParentVM.IReactiveObject.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWNestClass#TestNs.ParentVM.IRxObj.verified.cs index dc8eecbe..d4dd5201 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithNestedClass#TestNs.ParentVM.IReactiveObject.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.FRxObjWNestClass#TestNs.ParentVM.IRxObj.verified.cs @@ -1,4 +1,4 @@ -//HintName: TestNs.ParentVM.IReactiveObject.g.cs +//HintName: TestNs.ParentVM.IReactiveObject.g.cs // #pragma warning disable #nullable enable diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.Interface#IRxObjAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.Interface#IRxObjAttr.verified.cs new file mode 100644 index 00000000..fa7282c7 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.Interface#IRxObjAttr.verified.cs @@ -0,0 +1,19 @@ +//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// IReactiveObject Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] +internal sealed class IReactiveObjectAttribute : global::System.Attribute; +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.Interface#TestNs.TestVM.IRxObj.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.Interface#TestNs.TestVM.IRxObj.verified.cs new file mode 100644 index 00000000..69a07712 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.Interface#TestNs.TestVM.IRxObj.verified.cs @@ -0,0 +1,68 @@ +//HintName: TestNs.TestVM.IReactiveObject.g.cs +// +#pragma warning disable +#nullable enable +using System; +using System.Diagnostics.CodeAnalysis; +using System.ComponentModel; +using ReactiveUI; + +namespace TestNs +{ + /// + /// Partial class for the TestVM which contains ReactiveUI IReactiveObject initialization. + /// + public partial class TestVM : IReactiveObject + { + private bool _propertyChangingEventsSubscribed; + private bool _propertyChangedEventsSubscribed; + + /// + public event PropertyChangingEventHandler? PropertyChanging + { + add + { + if (!_propertyChangingEventsSubscribed) + { + this.SubscribePropertyChangingEvents(); + _propertyChangingEventsSubscribed = true; + } + + PropertyChangingHandler += value; + } + remove => PropertyChangingHandler -= value; + } + + /// + public event PropertyChangedEventHandler? PropertyChanged + { + add + { + if (!_propertyChangedEventsSubscribed) + { + this.SubscribePropertyChangedEvents(); + _propertyChangedEventsSubscribed = true; + } + + PropertyChangedHandler += value; + } + remove => PropertyChangedHandler -= value; + } + + [SuppressMessage("Roslynator", "RCS1159:Use EventHandler", Justification = "Long term design.")] + private event PropertyChangingEventHandler? PropertyChangingHandler; + + [SuppressMessage("Roslynator", "RCS1159:Use EventHandler", Justification = "Long term design.")] + private event PropertyChangedEventHandler? PropertyChangedHandler; + + /// + void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) => + PropertyChangingHandler?.Invoke(this, args); + + /// + void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) => + PropertyChangedHandler?.Invoke(this, args); + } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.MultiNs#IRxObjAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.MultiNs#IRxObjAttr.verified.cs new file mode 100644 index 00000000..fa7282c7 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.MultiNs#IRxObjAttr.verified.cs @@ -0,0 +1,19 @@ +//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// IReactiveObject Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] +internal sealed class IReactiveObjectAttribute : global::System.Attribute; +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.MultiNs#Namespace1.TestVM.IReactiveObject.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.MultiNs#Ns1.TestVM.IRxObj.verified.cs similarity index 97% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.MultiNs#Namespace1.TestVM.IReactiveObject.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.MultiNs#Ns1.TestVM.IRxObj.verified.cs index 99bcd130..e2217c65 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.MultiNs#Namespace1.TestVM.IReactiveObject.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.MultiNs#Ns1.TestVM.IRxObj.verified.cs @@ -1,4 +1,4 @@ -//HintName: Namespace1.TestVM.IReactiveObject.g.cs +//HintName: Namespace1.TestVM.IReactiveObject.g.cs // #pragma warning disable #nullable enable diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.MultiNs#Namespace2.TestVM.IReactiveObject.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.MultiNs#Ns2.TestVM.IRxObj.verified.cs similarity index 97% rename from src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.MultiNs#Namespace2.TestVM.IReactiveObject.g.verified.cs rename to src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.MultiNs#Ns2.TestVM.IRxObj.verified.cs index 22b835d2..8c14b667 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.MultiNs#Namespace2.TestVM.IReactiveObject.g.verified.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.MultiNs#Ns2.TestVM.IRxObj.verified.cs @@ -1,4 +1,4 @@ -//HintName: Namespace2.TestVM.IReactiveObject.g.cs +//HintName: Namespace2.TestVM.IReactiveObject.g.cs // #pragma warning disable #nullable enable diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.Null#IRxObjAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.Null#IRxObjAttr.verified.cs new file mode 100644 index 00000000..fa7282c7 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.Null#IRxObjAttr.verified.cs @@ -0,0 +1,19 @@ +//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// IReactiveObject Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] +internal sealed class IReactiveObjectAttribute : global::System.Attribute; +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.Null#TestNs.TestVM.IRxObj.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.Null#TestNs.TestVM.IRxObj.verified.cs new file mode 100644 index 00000000..69a07712 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROE.Null#TestNs.TestVM.IRxObj.verified.cs @@ -0,0 +1,68 @@ +//HintName: TestNs.TestVM.IReactiveObject.g.cs +// +#pragma warning disable +#nullable enable +using System; +using System.Diagnostics.CodeAnalysis; +using System.ComponentModel; +using ReactiveUI; + +namespace TestNs +{ + /// + /// Partial class for the TestVM which contains ReactiveUI IReactiveObject initialization. + /// + public partial class TestVM : IReactiveObject + { + private bool _propertyChangingEventsSubscribed; + private bool _propertyChangedEventsSubscribed; + + /// + public event PropertyChangingEventHandler? PropertyChanging + { + add + { + if (!_propertyChangingEventsSubscribed) + { + this.SubscribePropertyChangingEvents(); + _propertyChangingEventsSubscribed = true; + } + + PropertyChangingHandler += value; + } + remove => PropertyChangingHandler -= value; + } + + /// + public event PropertyChangedEventHandler? PropertyChanged + { + add + { + if (!_propertyChangedEventsSubscribed) + { + this.SubscribePropertyChangedEvents(); + _propertyChangedEventsSubscribed = true; + } + + PropertyChangedHandler += value; + } + remove => PropertyChangedHandler -= value; + } + + [SuppressMessage("Roslynator", "RCS1159:Use EventHandler", Justification = "Long term design.")] + private event PropertyChangingEventHandler? PropertyChangingHandler; + + [SuppressMessage("Roslynator", "RCS1159:Use EventHandler", Justification = "Long term design.")] + private event PropertyChangedEventHandler? PropertyChangedHandler; + + /// + void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) => + PropertyChangingHandler?.Invoke(this, args); + + /// + void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) => + PropertyChangedHandler?.Invoke(this, args); + } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROG.Basic#IRxObjAttr.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROG.Basic#IRxObjAttr.verified.cs new file mode 100644 index 00000000..fa7282c7 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROG.Basic#IRxObjAttr.verified.cs @@ -0,0 +1,19 @@ +//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs +// Copyright (c) 2026 .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; + +/// +/// IReactiveObject Attribute. +/// +/// +[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] +internal sealed class IReactiveObjectAttribute : global::System.Attribute; +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROG.Basic#TestNs.TestVM.IRxObj.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROG.Basic#TestNs.TestVM.IRxObj.verified.cs new file mode 100644 index 00000000..69a07712 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/ROG.Basic#TestNs.TestVM.IRxObj.verified.cs @@ -0,0 +1,68 @@ +//HintName: TestNs.TestVM.IReactiveObject.g.cs +// +#pragma warning disable +#nullable enable +using System; +using System.Diagnostics.CodeAnalysis; +using System.ComponentModel; +using ReactiveUI; + +namespace TestNs +{ + /// + /// Partial class for the TestVM which contains ReactiveUI IReactiveObject initialization. + /// + public partial class TestVM : IReactiveObject + { + private bool _propertyChangingEventsSubscribed; + private bool _propertyChangedEventsSubscribed; + + /// + public event PropertyChangingEventHandler? PropertyChanging + { + add + { + if (!_propertyChangingEventsSubscribed) + { + this.SubscribePropertyChangingEvents(); + _propertyChangingEventsSubscribed = true; + } + + PropertyChangingHandler += value; + } + remove => PropertyChangingHandler -= value; + } + + /// + public event PropertyChangedEventHandler? PropertyChanged + { + add + { + if (!_propertyChangedEventsSubscribed) + { + this.SubscribePropertyChangedEvents(); + _propertyChangedEventsSubscribed = true; + } + + PropertyChangedHandler += value; + } + remove => PropertyChangedHandler -= value; + } + + [SuppressMessage("Roslynator", "RCS1159:Use EventHandler", Justification = "Long term design.")] + private event PropertyChangingEventHandler? PropertyChangingHandler; + + [SuppressMessage("Roslynator", "RCS1159:Use EventHandler", Justification = "Long term design.")] + private event PropertyChangedEventHandler? PropertyChangedHandler; + + /// + void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) => + PropertyChangingHandler?.Invoke(this, args); + + /// + void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) => + PropertyChangedHandler?.Invoke(this, args); + } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectRecord#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectRecord#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs deleted file mode 100644 index 159a4426..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectRecord#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// IReactiveObject Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IReactiveObjectAttribute : global::System.Attribute; -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithAccessModifiers#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithAccessModifiers#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs deleted file mode 100644 index 159a4426..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithAccessModifiers#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// IReactiveObject Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IReactiveObjectAttribute : global::System.Attribute; -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithAccessModifiers#TestNs.TestVM.IReactiveObject.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithAccessModifiers#TestNs.TestVM.IReactiveObject.g.verified.cs deleted file mode 100644 index cb482d41..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithAccessModifiers#TestNs.TestVM.IReactiveObject.g.verified.cs +++ /dev/null @@ -1,68 +0,0 @@ -//HintName: TestNs.TestVM.IReactiveObject.g.cs -// -#pragma warning disable -#nullable enable -using System; -using System.Diagnostics.CodeAnalysis; -using System.ComponentModel; -using ReactiveUI; - -namespace TestNs -{ - /// - /// Partial class for the TestVM which contains ReactiveUI IReactiveObject initialization. - /// - public partial class TestVM : IReactiveObject - { - private bool _propertyChangingEventsSubscribed; - private bool _propertyChangedEventsSubscribed; - - /// - public event PropertyChangingEventHandler? PropertyChanging - { - add - { - if (!_propertyChangingEventsSubscribed) - { - this.SubscribePropertyChangingEvents(); - _propertyChangingEventsSubscribed = true; - } - - PropertyChangingHandler += value; - } - remove => PropertyChangingHandler -= value; - } - - /// - public event PropertyChangedEventHandler? PropertyChanged - { - add - { - if (!_propertyChangedEventsSubscribed) - { - this.SubscribePropertyChangedEvents(); - _propertyChangedEventsSubscribed = true; - } - - PropertyChangedHandler += value; - } - remove => PropertyChangedHandler -= value; - } - - [SuppressMessage("Roslynator", "RCS1159:Use EventHandler", Justification = "Long term design.")] - private event PropertyChangingEventHandler? PropertyChangingHandler; - - [SuppressMessage("Roslynator", "RCS1159:Use EventHandler", Justification = "Long term design.")] - private event PropertyChangedEventHandler? PropertyChangedHandler; - - /// - void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) => - PropertyChangingHandler?.Invoke(this, args); - - /// - void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) => - PropertyChangedHandler?.Invoke(this, args); - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithAttributes#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithAttributes#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs deleted file mode 100644 index 159a4426..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithAttributes#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// IReactiveObject Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IReactiveObjectAttribute : global::System.Attribute; -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithAttributes#TestNs.TestVM.IReactiveObject.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithAttributes#TestNs.TestVM.IReactiveObject.g.verified.cs deleted file mode 100644 index cb482d41..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithAttributes#TestNs.TestVM.IReactiveObject.g.verified.cs +++ /dev/null @@ -1,68 +0,0 @@ -//HintName: TestNs.TestVM.IReactiveObject.g.cs -// -#pragma warning disable -#nullable enable -using System; -using System.Diagnostics.CodeAnalysis; -using System.ComponentModel; -using ReactiveUI; - -namespace TestNs -{ - /// - /// Partial class for the TestVM which contains ReactiveUI IReactiveObject initialization. - /// - public partial class TestVM : IReactiveObject - { - private bool _propertyChangingEventsSubscribed; - private bool _propertyChangedEventsSubscribed; - - /// - public event PropertyChangingEventHandler? PropertyChanging - { - add - { - if (!_propertyChangingEventsSubscribed) - { - this.SubscribePropertyChangingEvents(); - _propertyChangingEventsSubscribed = true; - } - - PropertyChangingHandler += value; - } - remove => PropertyChangingHandler -= value; - } - - /// - public event PropertyChangedEventHandler? PropertyChanged - { - add - { - if (!_propertyChangedEventsSubscribed) - { - this.SubscribePropertyChangedEvents(); - _propertyChangedEventsSubscribed = true; - } - - PropertyChangedHandler += value; - } - remove => PropertyChangedHandler -= value; - } - - [SuppressMessage("Roslynator", "RCS1159:Use EventHandler", Justification = "Long term design.")] - private event PropertyChangingEventHandler? PropertyChangingHandler; - - [SuppressMessage("Roslynator", "RCS1159:Use EventHandler", Justification = "Long term design.")] - private event PropertyChangedEventHandler? PropertyChangedHandler; - - /// - void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) => - PropertyChangingHandler?.Invoke(this, args); - - /// - void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) => - PropertyChangedHandler?.Invoke(this, args); - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithDeeplyNestedClasses#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithDeeplyNestedClasses#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs deleted file mode 100644 index 159a4426..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithDeeplyNestedClasses#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// IReactiveObject Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IReactiveObjectAttribute : global::System.Attribute; -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithGenericClass#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithGenericClass#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs deleted file mode 100644 index 159a4426..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithGenericClass#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// IReactiveObject Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IReactiveObjectAttribute : global::System.Attribute; -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithInheritanceModifiers#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithInheritanceModifiers#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs deleted file mode 100644 index 159a4426..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithInheritanceModifiers#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// IReactiveObject Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IReactiveObjectAttribute : global::System.Attribute; -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithMultipleProperties#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithMultipleProperties#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs deleted file mode 100644 index 159a4426..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithMultipleProperties#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// IReactiveObject Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IReactiveObjectAttribute : global::System.Attribute; -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithMultipleProperties#TestNs.TestVM.IReactiveObject.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithMultipleProperties#TestNs.TestVM.IReactiveObject.g.verified.cs deleted file mode 100644 index cb482d41..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithMultipleProperties#TestNs.TestVM.IReactiveObject.g.verified.cs +++ /dev/null @@ -1,68 +0,0 @@ -//HintName: TestNs.TestVM.IReactiveObject.g.cs -// -#pragma warning disable -#nullable enable -using System; -using System.Diagnostics.CodeAnalysis; -using System.ComponentModel; -using ReactiveUI; - -namespace TestNs -{ - /// - /// Partial class for the TestVM which contains ReactiveUI IReactiveObject initialization. - /// - public partial class TestVM : IReactiveObject - { - private bool _propertyChangingEventsSubscribed; - private bool _propertyChangedEventsSubscribed; - - /// - public event PropertyChangingEventHandler? PropertyChanging - { - add - { - if (!_propertyChangingEventsSubscribed) - { - this.SubscribePropertyChangingEvents(); - _propertyChangingEventsSubscribed = true; - } - - PropertyChangingHandler += value; - } - remove => PropertyChangingHandler -= value; - } - - /// - public event PropertyChangedEventHandler? PropertyChanged - { - add - { - if (!_propertyChangedEventsSubscribed) - { - this.SubscribePropertyChangedEvents(); - _propertyChangedEventsSubscribed = true; - } - - PropertyChangedHandler += value; - } - remove => PropertyChangedHandler -= value; - } - - [SuppressMessage("Roslynator", "RCS1159:Use EventHandler", Justification = "Long term design.")] - private event PropertyChangingEventHandler? PropertyChangingHandler; - - [SuppressMessage("Roslynator", "RCS1159:Use EventHandler", Justification = "Long term design.")] - private event PropertyChangedEventHandler? PropertyChangedHandler; - - /// - void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) => - PropertyChangingHandler?.Invoke(this, args); - - /// - void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) => - PropertyChangedHandler?.Invoke(this, args); - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithMultipleTypeConstraints#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithMultipleTypeConstraints#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs deleted file mode 100644 index 159a4426..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithMultipleTypeConstraints#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// IReactiveObject Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IReactiveObjectAttribute : global::System.Attribute; -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithNestedClass#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithNestedClass#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs deleted file mode 100644 index 159a4426..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.FromReactiveObjectWithNestedClass#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// IReactiveObject Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IReactiveObjectAttribute : global::System.Attribute; -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.Interface#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.Interface#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs deleted file mode 100644 index 159a4426..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.Interface#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// IReactiveObject Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IReactiveObjectAttribute : global::System.Attribute; -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.Interface#TestNs.TestVM.IReactiveObject.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.Interface#TestNs.TestVM.IReactiveObject.g.verified.cs deleted file mode 100644 index cb482d41..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.Interface#TestNs.TestVM.IReactiveObject.g.verified.cs +++ /dev/null @@ -1,68 +0,0 @@ -//HintName: TestNs.TestVM.IReactiveObject.g.cs -// -#pragma warning disable -#nullable enable -using System; -using System.Diagnostics.CodeAnalysis; -using System.ComponentModel; -using ReactiveUI; - -namespace TestNs -{ - /// - /// Partial class for the TestVM which contains ReactiveUI IReactiveObject initialization. - /// - public partial class TestVM : IReactiveObject - { - private bool _propertyChangingEventsSubscribed; - private bool _propertyChangedEventsSubscribed; - - /// - public event PropertyChangingEventHandler? PropertyChanging - { - add - { - if (!_propertyChangingEventsSubscribed) - { - this.SubscribePropertyChangingEvents(); - _propertyChangingEventsSubscribed = true; - } - - PropertyChangingHandler += value; - } - remove => PropertyChangingHandler -= value; - } - - /// - public event PropertyChangedEventHandler? PropertyChanged - { - add - { - if (!_propertyChangedEventsSubscribed) - { - this.SubscribePropertyChangedEvents(); - _propertyChangedEventsSubscribed = true; - } - - PropertyChangedHandler += value; - } - remove => PropertyChangedHandler -= value; - } - - [SuppressMessage("Roslynator", "RCS1159:Use EventHandler", Justification = "Long term design.")] - private event PropertyChangingEventHandler? PropertyChangingHandler; - - [SuppressMessage("Roslynator", "RCS1159:Use EventHandler", Justification = "Long term design.")] - private event PropertyChangedEventHandler? PropertyChangedHandler; - - /// - void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) => - PropertyChangingHandler?.Invoke(this, args); - - /// - void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) => - PropertyChangedHandler?.Invoke(this, args); - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.MultiNs#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.MultiNs#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs deleted file mode 100644 index 159a4426..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.MultiNs#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// IReactiveObject Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IReactiveObjectAttribute : global::System.Attribute; -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.Nullable#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.Nullable#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs deleted file mode 100644 index 159a4426..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.Nullable#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// IReactiveObject Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IReactiveObjectAttribute : global::System.Attribute; -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.Nullable#TestNs.TestVM.IReactiveObject.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.Nullable#TestNs.TestVM.IReactiveObject.g.verified.cs deleted file mode 100644 index cb482d41..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.Nullable#TestNs.TestVM.IReactiveObject.g.verified.cs +++ /dev/null @@ -1,68 +0,0 @@ -//HintName: TestNs.TestVM.IReactiveObject.g.cs -// -#pragma warning disable -#nullable enable -using System; -using System.Diagnostics.CodeAnalysis; -using System.ComponentModel; -using ReactiveUI; - -namespace TestNs -{ - /// - /// Partial class for the TestVM which contains ReactiveUI IReactiveObject initialization. - /// - public partial class TestVM : IReactiveObject - { - private bool _propertyChangingEventsSubscribed; - private bool _propertyChangedEventsSubscribed; - - /// - public event PropertyChangingEventHandler? PropertyChanging - { - add - { - if (!_propertyChangingEventsSubscribed) - { - this.SubscribePropertyChangingEvents(); - _propertyChangingEventsSubscribed = true; - } - - PropertyChangingHandler += value; - } - remove => PropertyChangingHandler -= value; - } - - /// - public event PropertyChangedEventHandler? PropertyChanged - { - add - { - if (!_propertyChangedEventsSubscribed) - { - this.SubscribePropertyChangedEvents(); - _propertyChangedEventsSubscribed = true; - } - - PropertyChangedHandler += value; - } - remove => PropertyChangedHandler -= value; - } - - [SuppressMessage("Roslynator", "RCS1159:Use EventHandler", Justification = "Long term design.")] - private event PropertyChangingEventHandler? PropertyChangingHandler; - - [SuppressMessage("Roslynator", "RCS1159:Use EventHandler", Justification = "Long term design.")] - private event PropertyChangedEventHandler? PropertyChangedHandler; - - /// - void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) => - PropertyChangingHandler?.Invoke(this, args); - - /// - void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) => - PropertyChangedHandler?.Invoke(this, args); - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.WithOap#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.WithOap#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs deleted file mode 100644 index 159a4426..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.WithOap#ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs -// Copyright (c) 2026 .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; - -/// -/// IReactiveObject Attribute. -/// -/// -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IReactiveObjectAttribute : global::System.Attribute; -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.WithOap#TestNs.TestVM.IReactiveObject.g.verified.cs b/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.WithOap#TestNs.TestVM.IReactiveObject.g.verified.cs deleted file mode 100644 index cb482d41..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/REACTIVEOBJ/RxObjExtTests.WithOap#TestNs.TestVM.IReactiveObject.g.verified.cs +++ /dev/null @@ -1,68 +0,0 @@ -//HintName: TestNs.TestVM.IReactiveObject.g.cs -// -#pragma warning disable -#nullable enable -using System; -using System.Diagnostics.CodeAnalysis; -using System.ComponentModel; -using ReactiveUI; - -namespace TestNs -{ - /// - /// Partial class for the TestVM which contains ReactiveUI IReactiveObject initialization. - /// - public partial class TestVM : IReactiveObject - { - private bool _propertyChangingEventsSubscribed; - private bool _propertyChangedEventsSubscribed; - - /// - public event PropertyChangingEventHandler? PropertyChanging - { - add - { - if (!_propertyChangingEventsSubscribed) - { - this.SubscribePropertyChangingEvents(); - _propertyChangingEventsSubscribed = true; - } - - PropertyChangingHandler += value; - } - remove => PropertyChangingHandler -= value; - } - - /// - public event PropertyChangedEventHandler? PropertyChanged - { - add - { - if (!_propertyChangedEventsSubscribed) - { - this.SubscribePropertyChangedEvents(); - _propertyChangedEventsSubscribed = true; - } - - PropertyChangedHandler += value; - } - remove => PropertyChangedHandler -= value; - } - - [SuppressMessage("Roslynator", "RCS1159:Use EventHandler", Justification = "Long term design.")] - private event PropertyChangingEventHandler? PropertyChangingHandler; - - [SuppressMessage("Roslynator", "RCS1159:Use EventHandler", Justification = "Long term design.")] - private event PropertyChangedEventHandler? PropertyChangedHandler; - - /// - void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) => - PropertyChangingHandler?.Invoke(this, args); - - /// - void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) => - PropertyChangedHandler?.Invoke(this, args); - } -} -#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 4b13e39b..12ad884e 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/ReactiveUI.SourceGenerators.Tests.csproj +++ b/src/ReactiveUI.SourceGenerator.Tests/ReactiveUI.SourceGenerators.Tests.csproj @@ -12,12 +12,18 @@ true + + + + + + + + - - diff --git a/src/ReactiveUI.SourceGenerator.Tests/TestHelper.cs b/src/ReactiveUI.SourceGenerator.Tests/TestHelper.cs index 1d4f49f2..98872f35 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/TestHelper.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/TestHelper.cs @@ -50,52 +50,46 @@ public sealed partial class TestHelper : IDisposable /// Tests a generator expecting it to fail by throwing an . /// The source code to test. + /// The calling test, which names the snapshots. + /// The calling test's file, whose name is its class name. /// A task representing the asynchronous assertion operation. - public async Task TestFail(string source) => - await Assert.That(() => RunGeneratorAndCheck(source)).Throws(); + public async Task TestFail(string source, [CallerMemberName] string methodName = "", [CallerFilePath] string filePath = "") => + await Assert.That(() => RunGeneratorAndCheck(source, withPreDiagnosics: false, methodName, filePath)).Throws(); /// Tests a generator expecting it to pass successfully. /// The source code to test. + /// The calling test, which names the snapshots. + /// The calling test's file, whose name is its class name. /// A task representing the asynchronous verification operation. - public Task TestPass(string source) => - TestPass(source, withPreDiagnosics: false); + public Task TestPass(string source, [CallerMemberName] string methodName = "", [CallerFilePath] string filePath = "") => + RunGeneratorAndCheck(source, withPreDiagnosics: false, methodName, filePath); /// Tests a generator expecting it to pass successfully. /// The source code to test. /// if set to true [with pre diagnosics]. + /// The calling test, which names the snapshots. + /// The calling test's file, whose name is its class name. /// A task representing the asynchronous verification operation. - public Task TestPass(string source, bool withPreDiagnosics) => - RunGeneratorAndCheck(source, withPreDiagnosics); + public Task TestPass(string source, bool withPreDiagnosics, [CallerMemberName] string methodName = "", [CallerFilePath] string filePath = "") => + RunGeneratorAndCheck(source, withPreDiagnosics, methodName, filePath); /// public void Dispose() { } - /// Runs the specified source generator and validates the generated code. - /// The code to be parsed and processed by the generator. - /// The generator driver used to run the generator. - /// Thrown if the compilation fails. - public SettingsTask RunGeneratorAndCheck(string code) => - RunGeneratorAndCheck(code, withPreDiagnosics: false, rerunCompilation: true); - - /// Runs the specified source generator and validates the generated code. - /// The code to be parsed and processed by the generator. - /// if set to true [with pre diagnosics]. - /// The generator driver used to run the generator. - public SettingsTask RunGeneratorAndCheck(string code, bool withPreDiagnosics) => - RunGeneratorAndCheck(code, withPreDiagnosics, rerunCompilation: true); - - /// Runs the specified source generator and validates the generated code. + /// Runs the specified source generator, validates the generated code and compares it with its snapshots. /// The code to be parsed and processed by the generator. /// if set to true [with pre diagnosics]. - /// Indicates whether to rerun the compilation after running the generator. - /// The generator driver used to run the generator. + /// The calling test, which names the snapshots. + /// The calling test's file, whose name is its class name. + /// A task that completes once the snapshots have been compared. /// Thrown if the compilation fails. - public SettingsTask RunGeneratorAndCheck( + public Task RunGeneratorAndCheck( string code, bool withPreDiagnosics, - bool rerunCompilation) + string methodName, + string filePath) { var parseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp13); var compilation = CreateTestCompilation(code, parseOptions); @@ -118,10 +112,8 @@ public SettingsTask RunGeneratorAndCheck( var generator = new T(); var driver = CSharpGeneratorDriver.Create(generator).WithUpdatedParseOptions(parseOptions); - - return rerunCompilation - ? RunGeneratorAndVerify(code, driver, compilation) - : VerifyGenerator(driver.RunGenerators(compilation)); + var rerunDriver = RunGeneratorAndValidate(code, driver, compilation); + return GeneratorSnapshot.VerifyAsync(rerunDriver, GetVerifiedFilePath(), Path.GetFileNameWithoutExtension(filePath), methodName); } /// Gets the verified file path for generator type . @@ -133,7 +125,6 @@ private static string GetVerifiedFilePath() { nameof(ReactiveGenerator) => "REACTIVE", nameof(ReactiveCommandGenerator) => "REACTIVECMD", - nameof(ObservableAsPropertyGenerator) => "OAPH", nameof(IViewForGenerator) => "IVIEWFOR", nameof(RoutedControlHostGenerator) => "ROUTEDHOST", nameof(ViewModelControlHostGenerator) => "CONTROLHOST", @@ -180,7 +171,6 @@ private static void AddGeneratorSpecificSyntaxTrees(List syntaxTrees if (typeof(T) == typeof(ReactiveObjectGenerator)) { AddSyntaxTree(syntaxTrees, GetAttributeDefinitionsPropertyResult(ReactiveAttributeName), parseOptions, ReactiveAttributeHintName); - AddSyntaxTree(syntaxTrees, GetAttributeDefinitionsPropertyResult("ObservableAsPropertyAttribute"), parseOptions, "ObservableAsPropertyAttribute.g.cs"); } if (typeof(T) != typeof(BindableDerivedListGenerator) && typeof(T) != typeof(ReactiveCollectionGenerator)) @@ -216,14 +206,14 @@ private static void AddSyntaxTree(List syntaxTrees, string source, C /// The original source code. /// The configured generator driver. /// The input compilation. - /// The snapshot verification settings. - private static SettingsTask RunGeneratorAndVerify(string code, GeneratorDriver driver, Compilation compilation) + /// The driver after the run. + private static GeneratorDriver RunGeneratorAndValidate(string code, GeneratorDriver driver, Compilation compilation) { var rerunDriver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var diagnostics); ThrowIfDiagnosticsExist(GetDiagnosticsAtLeastSeverity(diagnostics, DiagnosticSeverity.Warning), "Diagnostic", "Compilation failed due to the above diagnostics."); ThrowIfDiagnosticsExist(GetUnexpectedOutputDiagnostics(outputCompilation.GetDiagnostics()), "Output diagnostic", "Output compilation failed due to the above diagnostics."); ValidateGeneratedCode(code, rerunDriver); - return VerifyGenerator(rerunDriver); + return rerunDriver; } /// Writes diagnostics and throws when a collection is non-empty. @@ -275,11 +265,6 @@ private static void AddRequiredAttributeDefinitions(List supportSources) supportSources.Add(GetAttributeDefinitionsPropertyResult("IViewForAttribute")); } - if (typeof(T) != typeof(ObservableAsPropertyGenerator) && typeof(T) != typeof(ReactiveObjectGenerator)) - { - supportSources.Add(GetAttributeDefinitionsPropertyResult("ObservableAsPropertyAttribute")); - } - AddRemainingAttributeDefinitions(supportSources); } @@ -623,12 +608,4 @@ private static bool ContainsPropertyNotification(string generatedCode, string pr /// Writes a validation message to the current test output. /// The message to write. private static void WriteTestOutput(string message) => TestContext.Current?.OutputWriter.WriteLine(message); - - /// Creates snapshot verification settings for a generator driver. - /// The generator driver to verify. - /// The snapshot verification settings. - private static SettingsTask VerifyGenerator(GeneratorDriver driver) => - Verify(driver) - .UseDirectory(GetVerifiedFilePath()) - .ScrubLinesContaining("[global::System.CodeDom.Compiler.GeneratedCode(\""); - } +} diff --git a/src/ReactiveUI.SourceGenerator.Tests/UnitTests/AttributeDataExtensionTests.cs b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/AttributeDataExtensionTests.cs index 606193d2..517ccf49 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/UnitTests/AttributeDataExtensionTests.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/AttributeDataExtensionTests.cs @@ -380,7 +380,7 @@ public class C { } var compilation = CreateCompilation(source); var classDeclaration = await GetClassDeclaration(compilation); var semanticModel = compilation.GetSemanticModel(classDeclaration.SyntaxTree); - var typeSymbol = (INamedTypeSymbol)compilation.GetTypeByMetadataName("T.C")!; + var typeSymbol = compilation.GetTypeByMetadataName("T.C")!; AttributeData? triggerAttr = null; foreach (var candidate in typeSymbol.GetAttributes()) { diff --git a/src/ReactiveUI.SourceGenerator.Tests/UnitTests/DiagnosticSuppressorTests.cs b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/DiagnosticSuppressorTests.cs index 1fcc09cd..d5fcaa81 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/UnitTests/DiagnosticSuppressorTests.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/DiagnosticSuppressorTests.cs @@ -18,10 +18,10 @@ public sealed class DiagnosticSuppressorTests private const int InvalidTargetDiagnosticCount = 4; /// The number of synthetic diagnostics expected to be suppressed. - private const int SyntheticSuppressedDiagnosticCount = 8; + private const int SyntheticSuppressedDiagnosticCount = 2; /// The number of synthetic diagnostics intentionally left unsuppressed. - private const int SyntheticUnsuppressedDiagnosticCount = 7; + private const int SyntheticUnsuppressedDiagnosticCount = 6; /// Source containing each invalid generated-member attribute target. private const string AttributeTargetSource = """ @@ -77,8 +77,6 @@ public sealed class ReactiveAttribute : Attribute; [AttributeUsage(AttributeTargets.Method)] public sealed class ReactiveCommandAttribute : Attribute; - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property)] - public sealed class ObservableAsPropertyAttribute : Attribute; } namespace TestNs @@ -99,26 +97,14 @@ private void Plain() { } - [ReactiveUI.SourceGenerators.ObservableAsProperty] - [field: Obsolete] - private object Observe() => new(); [field: Obsolete] private object NotObservable() => new(); - [ReactiveUI.SourceGenerators.ObservableAsProperty] - private object ObservableValue => new(); - - [ReactiveUI.SourceGenerators.ObservableAsProperty] - [property: Obsolete] - private object ObservePropertyTarget() => new(); [method: Obsolete] private object MethodTarget() => new(); - [ReactiveUI.SourceGenerators.ObservableAsProperty] - [field: Obsolete] - private object ObservablePropertyTarget => new(); } } """; @@ -176,18 +162,12 @@ await AssertDescriptor( new ReactiveCommandAttributeWithFieldOrPropertyTargetDiagnosticSuppressor(), "RXUISPR0001", InvalidAttributeTargetDiagnosticId); - await AssertDescriptor( - new ObservableAsPropertyAttributeWithFieldNeverReadDiagnosticSuppressor(), - "RXUISPR0002", - "IDE0052"); + await AssertDescriptor( new ReactiveCommandMethodDoesNotNeedToBeStaticDiagnosticSuppressor(), "RXUISPR0003", "CA1822"); - await AssertDescriptor( - new OAPHMethodDoesNotNeedToBeStaticDiagnosticSuppressor(), - "RXUISPR0003", - "CA1822"); + await AssertDescriptor( new ReactiveFieldDoesNotNeedToBeReadOnlyDiagnosticSuppressor(), "RXUISPR0004", @@ -260,8 +240,7 @@ public async Task MemberSuppressors_SuppressOnlyMatchingSyntheticDiagnostics() ImmutableArray analyzers = [ CreateMemberCoverageDiagnosticAnalyzer(), - new OAPHMethodDoesNotNeedToBeStaticDiagnosticSuppressor(), - new ObservableAsPropertyAttributeWithFieldNeverReadDiagnosticSuppressor(), + new ReactiveCommandMethodDoesNotNeedToBeStaticDiagnosticSuppressor(), new ReactiveFieldDoesNotNeedToBeReadOnlyDiagnosticSuppressor(), ]; diff --git a/src/ReactiveUI.SourceGenerator.Tests/UnitTests/GeneratedOutputCoverageTests.cs b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/GeneratedOutputCoverageTests.cs index ed1400ff..5f4d8a45 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/UnitTests/GeneratedOutputCoverageTests.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/GeneratedOutputCoverageTests.cs @@ -105,10 +105,10 @@ public partial class DerivedListViewModel await Assert.That(generatedSource.Contains("DataMemberAttribute", StringComparison.Ordinal)).IsTrue(); } - /// ObservableAsProperty fields cover invalid targets, collisions, and inheritance modifiers. + /// Reactive fields cover invalid targets, collisions, and inheritance modifiers. /// A task representing the asynchronous assertion work. [Test] - public async Task ObservableAsPropertyFieldsCoverValidationAndInheritanceOutput() + public async Task ReactiveFieldsCoverValidationAndInheritanceOutput() { const string source = """ using ReactiveUI; @@ -116,37 +116,34 @@ public async Task ObservableAsPropertyFieldsCoverValidationAndInheritanceOutput( namespace Coverage; - public partial class InvalidObservableTarget + public partial class InvalidReactiveTarget { - [ObservableAsProperty] + [Reactive] private int _invalid; } - public class ObservableBase : ReactiveObject + public class ReactiveBase : ReactiveObject { public virtual int Override { get; set; } } - public partial class ObservableViewModel : ObservableBase + public partial class ReactiveViewModel : ReactiveBase { - [ObservableAsProperty] + [Reactive] private int Collision; - [ObservableAsProperty(Inheritance = InheritanceModifier.Virtual)] + [Reactive(Inheritance = InheritanceModifier.Virtual)] private int _virtual; - [ObservableAsProperty(Inheritance = InheritanceModifier.Override)] + [Reactive(Inheritance = InheritanceModifier.Override)] private int _override; - [ObservableAsProperty(Inheritance = InheritanceModifier.New)] + [Reactive(Inheritance = InheritanceModifier.New)] private int _new; } """; - var (generatedSource, diagnostics) = RunGenerator( - source, - new ObservableAsPropertyGenerator(), - new ReactiveGenerator()); + var (generatedSource, diagnostics) = RunGenerator(source, new ReactiveGenerator()); var diagnosticIds = GetDiagnosticIds(diagnostics); await Assert.That(diagnosticIds).Contains("RXUISG0018"); diff --git a/src/ReactiveUI.SourceGenerator.Tests/UnitTests/IViewForGeneratorTests.cs b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/IViewForGeneratorTests.cs index 8a768e7d..fabfd560 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/UnitTests/IViewForGeneratorTests.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/IViewForGeneratorTests.cs @@ -10,14 +10,11 @@ namespace ReactiveUI.SourceGenerator.Tests; /// Tests view-for source generation. public class IViewForGeneratorTests : TestBase { - /// The generated source count for four supported platform targets. - private const int SupportedPlatformGeneratedSourceCount = 6; + /// The generated source count for four supported platform targets: the attribute and one file per view. + private const int SupportedPlatformGeneratedSourceCount = 5; - /// The generated source count when no target can produce a view implementation. - private const int NoViewImplementationGeneratedSourceCount = 2; - - /// The stable hint name of the generated registration extensions. - private const string RegistrationExtensionsHintName = "ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs"; + /// The generated source count when no target can produce a view implementation: the attribute alone. + private const int NoViewImplementationGeneratedSourceCount = 1; /// Tests that the source generator correctly generates reactive properties. /// A task to monitor the async. @@ -113,10 +110,10 @@ await Assert.That(mauiSource.Contains( StringComparison.Ordinal)).IsTrue(); } - /// Verifies WinUI, Uno, string view models, and every registration mapping. + /// Verifies WinUI, Uno and string view models, and that no view registration is generated. /// A task representing the asynchronous assertion work. [Test] - public async Task GeneratesWinUiUnoAndRegistrationVariants() + public async Task GeneratesWinUiAndUnoViewsWithoutRegistration() { var generatedSources = RunIViewForGenerator( """ @@ -124,19 +121,15 @@ public async Task GeneratesWinUiUnoAndRegistrationVariants() namespace Microsoft.UI.Xaml.Controls { public class Page { } } namespace Windows.UI.Xaml.Controls { public class Page { } } - namespace ReactiveUI.SourceGenerators - { - internal enum SplatRegistrationType { None, LazySingleton, Constant, PerRequest } - } namespace TestNs { public sealed class ViewModel { } - [IViewFor(RegistrationType = SplatRegistrationType.LazySingleton, ViewModelRegistrationType = SplatRegistrationType.Constant)] + [IViewFor] public partial class WinUiView : Microsoft.UI.Xaml.Controls.Page { } - [IViewFor("TestNs.ViewModel", RegistrationType = SplatRegistrationType.PerRequest, ViewModelRegistrationType = SplatRegistrationType.PerRequest)] + [IViewFor("TestNs.ViewModel")] public partial class UnoView : Windows.UI.Xaml.Controls.Page { } [IViewFor("")] @@ -145,14 +138,11 @@ public partial class MissingViewModelView : Microsoft.UI.Xaml.Controls.Page { } """); var winUiSource = GetGeneratedSource(generatedSources, "TestNs.WinUiView.IViewFor.g.cs"); var unoSource = GetGeneratedSource(generatedSources, "TestNs.UnoView.IViewFor.g.cs"); - var registrationSource = GetGeneratedSource(generatedSources, RegistrationExtensionsHintName); await Assert.That(winUiSource.Contains("using Microsoft.UI.Xaml;", StringComparison.Ordinal)).IsTrue(); await Assert.That(unoSource.Contains("using Windows.UI.Xaml;", StringComparison.Ordinal)).IsTrue(); - await Assert.That(registrationSource.Contains("RegisterLazySingleton", StringComparison.Ordinal)).IsTrue(); - await Assert.That(registrationSource.Contains("RegisterConstant", StringComparison.Ordinal)).IsTrue(); - await Assert.That(registrationSource.Contains("Register", StringComparison.Ordinal)).IsTrue(); - await Assert.That(registrationSource.Contains("MissingViewModelView", StringComparison.Ordinal)).IsFalse(); + await Assert.That(generatedSources.Any(static source => source.HintName.Contains("MissingViewModelView", StringComparison.Ordinal))).IsFalse(); + await Assert.That(generatedSources.Any(static source => source.SourceText.ToString().Contains("RegisterViewsForViewModelsSourceGenerated", StringComparison.Ordinal))).IsFalse(); } /// Verifies unsupported and non-partial IViewFor targets do not emit view implementations. @@ -178,8 +168,6 @@ public class NonPartialView { } await Assert.That(generatedSources.Count).IsEqualTo(NoViewImplementationGeneratedSourceCount); await Assert.That(generatedSources.Any(static source => source.HintName.EndsWith(".IViewFor.g.cs", StringComparison.Ordinal))).IsFalse(); - await Assert.That(GetGeneratedSource(generatedSources, RegistrationExtensionsHintName).Contains("UnsupportedView", StringComparison.Ordinal)).IsFalse(); - await Assert.That(GetGeneratedSource(generatedSources, RegistrationExtensionsHintName).Contains("NonPartialView", StringComparison.Ordinal)).IsFalse(); } /// Runs the IViewFor generator and returns its emitted sources for focused assertions. diff --git a/src/ReactiveUI.SourceGenerator.Tests/UnitTests/IncrementalCachingTests.cs b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/IncrementalCachingTests.cs new file mode 100644 index 00000000..bf4d22db --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/IncrementalCachingTests.cs @@ -0,0 +1,209 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated 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.WinForms; + +namespace ReactiveUI.SourceGenerator.Tests; + +/// Verifies that an edit reruns only the per-type steps whose models it changed. +/// +/// Each generator groups its models per type and writes each type's file from its own output, so the driver can compare a +/// type's models with the last run's and skip the type when they are equal. The tests run a driver with step tracking, +/// edit one tree, and read the reason each tracked output was produced. +/// +public class IncrementalCachingTests +{ + /// A file no generator reads, edited to show unrelated edits cache every step. + private const string UnrelatedSource = "namespace Other { public class Unrelated { public int Value => 1; } }"; + + /// The number of types each test source declares for the generator. + private const int TypeCount = 2; + + /// An unrelated edit leaves every [Reactive] type cached; editing one type reruns only that type. + /// A task to monitor the async. + [Test] + public Task ReactiveCachesPerType() => AssertCachesPerType( + new ReactiveGenerator(), + TrackingNames.ReactiveFieldTypes, + """ + using ReactiveUI; + using ReactiveUI.SourceGenerators; + namespace TestNs; + public partial class First : ReactiveObject { [Reactive] private int _alpha; } + public partial class Second : ReactiveObject { [Reactive] private int _beta; } + """, + "_alpha;", + "_gamma;"); + + /// An unrelated edit leaves every [ReactiveCommand] type cached; editing one type reruns only that type. + /// A task to monitor the async. + [Test] + public Task ReactiveCommandCachesPerType() => AssertCachesPerType( + new ReactiveCommandGenerator(), + TrackingNames.ReactiveCommandTypes, + """ + using ReactiveUI; + using ReactiveUI.SourceGenerators; + namespace TestNs; + public partial class First : ReactiveObject { [ReactiveCommand] private void Save() { } } + public partial class Second : ReactiveObject { [ReactiveCommand] private void Load() { } } + """, + "Save()", + "Store()"); + + /// An unrelated edit leaves every [ReactiveCollection] type cached; editing one type reruns only that type. + /// A task to monitor the async. + [Test] + public Task ReactiveCollectionCachesPerType() => AssertCachesPerType( + new ReactiveCollectionGenerator(), + TrackingNames.ReactiveCollectionTypes, + """ + using System.Collections.ObjectModel; + using ReactiveUI; + using ReactiveUI.SourceGenerators; + namespace TestNs; + public partial class First : ReactiveObject { [ReactiveCollection] private ObservableCollection _alpha = []; } + public partial class Second : ReactiveObject { [ReactiveCollection] private ObservableCollection _beta = []; } + """, + "_alpha", + "_gamma"); + + /// An unrelated edit leaves every [BindableDerivedList] type cached; editing one type reruns only that type. + /// A task to monitor the async. + [Test] + public Task BindableDerivedListCachesPerType() => AssertCachesPerType( + new BindableDerivedListGenerator(), + TrackingNames.BindableDerivedListTypes, + """ + using System.Collections.ObjectModel; + using ReactiveUI; + using ReactiveUI.SourceGenerators; + namespace TestNs; + public partial class First : ReactiveObject { [BindableDerivedList] private ReadOnlyObservableCollection? _alpha; } + public partial class Second : ReactiveObject { [BindableDerivedList] private ReadOnlyObservableCollection? _beta; } + """, + "_alpha", + "_gamma"); + + /// An unrelated edit leaves every [IReactiveObject] type cached; editing one type reruns only that type. + /// A task to monitor the async. + [Test] + public Task ReactiveObjectCachesPerType() => AssertCachesPerType( + new ReactiveObjectGenerator(), + TrackingNames.ReactiveObjectTypes, + """ + using ReactiveUI.SourceGenerators; + namespace TestNs; + [IReactiveObject] public partial class First { } + [IReactiveObject] public partial class Second { } + """, + "partial class First", + "partial class Third"); + + /// An unrelated edit leaves every [IViewFor] type cached; editing one type reruns only that type. + /// A task to monitor the async. + [Test] + public Task ViewForCachesPerType() => AssertCachesPerType( + new IViewForGenerator(), + TrackingNames.ViewForTypes, + """ + using ReactiveUI.SourceGenerators; + namespace TestNs; + public sealed class FirstViewModel { } + public sealed class SecondViewModel { } + [IViewFor] public partial class FirstView : System.Windows.Window { } + [IViewFor] public partial class SecondView : System.Windows.Window { } + """, + "partial class FirstView", + "partial class ThirdView"); + + /// An unrelated edit leaves every [RoutedControlHost] host cached. + /// A task to monitor the async. + [Test] + public Task RoutedControlHostCachesPerType() => AssertCachesPerType( + new RoutedControlHostGenerator(), + TrackingNames.RoutedControlHosts, + """ + using ReactiveUI.SourceGenerators.WinForms; + namespace TestNs; + [RoutedControlHost("System.Windows.Forms.UserControl")] public partial class FirstHost { } + [RoutedControlHost("System.Windows.Forms.UserControl")] public partial class SecondHost { } + """, + "partial class FirstHost", + "partial class ThirdHost"); + + /// Runs a generator, then reruns it after an unrelated edit and after an edit to one of two types. + /// The generator. + /// The tracking name of the generator's per-type step. + /// Source declaring two types the generator writes for, the first of which is edited. + /// Text in the first type to change. + /// Its replacement, which changes the first type's model. + /// A task to monitor the async. + private static async Task AssertCachesPerType(IIncrementalGenerator generator, string stepName, string source, string find, string replace) + { + var parseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp13); + var generated = CSharpSyntaxTree.ParseText(source, parseOptions, path: "Types.cs"); + var unrelated = CSharpSyntaxTree.ParseText(UnrelatedSource, parseOptions, path: "Unrelated.cs"); + var stubs = CSharpSyntaxTree.ParseText(TestCompilationReferences.WindowsDesktopStubs, parseOptions, path: "Stubs.cs"); + Compilation compilation = CSharpCompilation.Create( + "IncrementalCaching", + [generated, unrelated, stubs], + TestCompilationReferences.CreatePortableDefault(), + new(OutputKind.DynamicallyLinkedLibrary)); + + GeneratorDriver driver = CSharpGeneratorDriver.Create( + [generator.AsSourceGenerator()], + parseOptions: parseOptions, + driverOptions: new(IncrementalGeneratorOutputKind.None, trackIncrementalGeneratorSteps: true)); + driver = driver.RunGenerators(compilation); + await Assert.That(Reasons(driver, stepName).Count).IsEqualTo(TypeCount); + + // An edit to a tree no generator reads: every per-type output is reused as it was. + var editedUnrelated = Microsoft.CodeAnalysis.Text.SourceText.From(UnrelatedSource.Replace("=> 1", "=> 2", StringComparison.Ordinal)); + var unrelatedEdit = compilation.ReplaceSyntaxTree(unrelated, unrelated.WithChangedText(editedUnrelated)); + var afterUnrelated = Reasons(driver.RunGenerators(unrelatedEdit), stepName); + await Assert.That(CountReused(afterUnrelated)).IsEqualTo(TypeCount); + + // An edit that changes the first type's model: the second type's output is still reused. + var relatedEdit = compilation.ReplaceSyntaxTree(generated, generated.WithChangedText(Microsoft.CodeAnalysis.Text.SourceText.From(source.Replace(find, replace, StringComparison.Ordinal)))); + var afterRelated = Reasons(driver.RunGenerators(relatedEdit), stepName); + await Assert.That(CountReused(afterRelated)).IsEqualTo(TypeCount - 1); + } + + /// Counts the outputs the driver reused rather than produced again. + /// The reasons each output was produced. + /// The number that were cached or unchanged. + private static int CountReused(List reasons) + { + var reused = 0; + foreach (var reason in reasons) + { + if (reason is IncrementalStepRunReason.Cached or IncrementalStepRunReason.Unchanged) + { + reused++; + } + } + + return reused; + } + + /// Reads the reason each output of a tracked step was produced in the driver's last run. + /// The driver. + /// The step's tracking name. + /// One reason per output. + private static List Reasons(GeneratorDriver driver, string stepName) + { + var reasons = new List(); + foreach (var step in driver.GetRunResult().Results[0].TrackedSteps[stepName]) + { + foreach (var (_, reason) in step.Outputs) + { + reasons.Add(reason); + } + } + + return reasons; + } +} diff --git a/src/ReactiveUI.SourceGenerator.Tests/UnitTests/OAPFromObservableGeneratorTests.cs b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/OAPFromObservableGeneratorTests.cs deleted file mode 100644 index 2f0f6e8d..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/UnitTests/OAPFromObservableGeneratorTests.cs +++ /dev/null @@ -1,392 +0,0 @@ -// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. -// ReactiveUI Association Incorporated licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. - -namespace ReactiveUI.SourceGenerator.Tests; - -/// Unit tests for the ObservableAsProperty generator. -public class OAPFromObservableGeneratorTests : TestBase -{ - /// Tests that the source generator correctly generates observable properties. - /// A task to monitor the async. - [Test] - public Task FromObservableProp() - { - // Arrange: Setup the source code that matches the generator input expectations. - const string sourceCode = """ - using System; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - using System.Reactive.Linq; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty] - public IObservable Test1 => Observable.Return(42); - } - """; - - // Act: Initialize the helper and run the generator. Assert: Verify the generated code. - return TestHelper.TestPass(sourceCode); - } - - /// Tests that the source generator correctly generates observable properties. - /// A task to monitor the async. - [Test] - public Task Nested() - { - // Arrange: Setup the source code that matches the generator input expectations. - const string sourceCode = """ - using System; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - using System.Reactive.Linq; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty] - public IObservable Test1 => Observable.Return(42); - - public partial class TestVMInner1 : ReactiveObject - { - [ObservableAsProperty] - public IObservable TestIn1 => Observable.Return(42); - } - - public partial class TestVMInner2 : ReactiveObject - { - [ObservableAsProperty] - public IObservable TestIn2 => Observable.Return(42); - - public partial class TestVMInner3 : ReactiveObject - { - [ObservableAsProperty] - public IObservable TestIn3 => Observable.Return(42); - } - } - } - """; - - // Act: Initialize the helper and run the generator. Assert: Verify the generated code. - return TestHelper.TestPass(sourceCode); - } - - /// Tests that the source generator correctly generates observable properties. - /// A task to monitor the async. - [Test] - public Task FromObservableMethods() - { - // Arrange: Setup the source code that matches the generator input expectations. - const string sourceCode = """ - using System; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - using System.Reactive.Linq; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty] - public IObservable Test2() => Observable.Return(42); - } - """; - - // Act: Initialize the helper and run the generator. Assert: Verify the generated code. - return TestHelper.TestPass(sourceCode); - } - - /// Tests that the source generator correctly generates observable properties. - /// A task to monitor the async. - [Test] - public Task FromObservableMethodsWithName() - { - // Arrange: Setup the source code that matches the generator input expectations. - const string sourceCode = """ - using System; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - using System.Reactive.Linq; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty(PropertyName = "MyNamedProperty")] - public IObservable Test3() => Observable.Return(42); - } - """; - - // Act: Initialize the helper and run the generator. Assert: Verify the generated code. - return TestHelper.TestPass(sourceCode); - } - - /// Tests that the source generator correctly generates observable properties. - /// A task to monitor the async. - [Test] - public Task WithName() - { - // Arrange: Setup the source code that matches the generator input expectations. - const string sourceCode = """ - using System; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - using System.Reactive.Linq; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty(PropertyName = "MyNamedProperty")] - public IObservable Test4 => Observable.Return(42); - } - """; - - // Act: Initialize the helper and run the generator. Assert: Verify the generated code. - return TestHelper.TestPass(sourceCode); - } - - /// Tests that the source generator correctly generates observable properties. - /// A task to monitor the async. - [Test] - public Task WithAttr() - { - // Arrange: Setup the source code that matches the generator input expectations. - const string sourceCode = """ - using System; - using System.Runtime.Serialization; - using System.Text.Json.Serialization; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - using System.Reactive.Linq; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty(PropertyName = "MyNamedProperty")] - [property: JsonInclude] - [DataMember] - public IObservable Test5 => Observable.Return(42); - } - """; - - // Act: Initialize the helper and run the generator. Assert: Verify the generated code. - return TestHelper.TestPass(sourceCode); - } - - /// Tests that the source generator correctly generates observable properties. - /// A task to monitor the async. - [Test] - public Task AttrRef() - { - // Arrange: Setup the source code that matches the generator input expectations. - const string sourceCode = """ - using System; - using System.Runtime.Serialization; - using System.Text.Json.Serialization; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - using System.Reactive.Linq; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty(PropertyName = "MyNamedProperty")] - [property: JsonInclude] - [DataMember] - public IObservable Test6 => Observable.Return(new object()); - } - """; - - // Act: Initialize the helper and run the generator. Assert: Verify the generated code. - return TestHelper.TestPass(sourceCode); - } - - /// Tests that the source generator correctly generates observable properties. - /// A task to monitor the async. - [Test] - public Task AttrNullRef() - { - // Arrange: Setup the source code that matches the generator input expectations. - const string sourceCode = """ - using System; - using System.Runtime.Serialization; - using System.Text.Json.Serialization; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - using System.Reactive.Linq; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty(PropertyName = "MyNamedProperty")] - [property: JsonInclude] - [DataMember] - public IObservable Test7 => Observable.Return(new object()); - } - """; - - // Act: Initialize the helper and run the generator. Assert: Verify the generated code. - return TestHelper.TestPass(sourceCode); - } - - /// Tests that the source generator correctly generates observable properties. - /// - /// A task to monitor the async. - /// - [Test] - public Task FromField() - { - // Arrange: Setup the source code that matches the generator input expectations. - const string sourceCode = """ - using System; - using System.Runtime.Serialization; - using System.Text.Json.Serialization; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - using System.Reactive.Linq; - using System.Reactive.Subjects; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - private readonly Subject _testSubject = new(); - - [property: JsonInclude] - [DataMember] - [ObservableAsProperty] - private double? _testProperty = 1.1d; - - public TestVM() - { - _testPropertyHelper = _testSubject.ToProperty(this, nameof(TestProperty)); - } - } - """; - - // Act: Initialize the helper and run the generator. Assert: Verify the generated code. - return TestHelper.TestPass(sourceCode); - } - - /// Tests that the source generator correctly generates observable properties. - /// - /// A task to monitor the async. - /// - [Test] - public Task FromPartialProperty() - { - // Arrange: Setup the source code that matches the generator input expectations. - const string sourceCode = """ - using System; - using System.Runtime.Serialization; - using System.Text.Json.Serialization; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - using System.Reactive.Linq; - using System.Reactive.Subjects; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - private readonly Subject _testSubject = new(); - - public TestVM() - { - _testPropertyHelper = _testSubject.ToProperty(this, nameof(TestProperty)); - } - - [JsonInclude] - [DataMember] - [ObservableAsProperty(InitialValue = "1.1d")] - public partial double? TestProperty { get; } - } - """; - - // Act: Initialize the helper and run the generator. Assert: Verify the generated code. - return TestHelper.TestPass(sourceCode); - } - - /// Tests that an empty string initial value initialises the generated backing field. - /// - /// A task to monitor the async. - /// - [Test] - public Task FromPartialPropertyWithEmptyStringInitialValue() - { - // Arrange: Setup the source code that matches the generator input expectations. - const string sourceCode = """ - using System; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - using System.Reactive.Linq; - using System.Reactive.Subjects; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - private readonly Subject _testSubject = new(); - - public TestVM() - { - _pLCActiveHelper = _testSubject.ToProperty(this, nameof(PLCActive)); - } - - [ObservableAsProperty(InitialValue = "")] - public partial string PLCActive { get; } - } - """; - - // Act: Initialize the helper and run the generator. Assert: Verify the generated code. - return TestHelper.TestPass(sourceCode); - } - - /// Tests that a non nullable string without an initial value defaults to an empty string. - /// - /// A task to monitor the async. - /// - [Test] - public Task FromPartialPropertyWithoutInitialValue() - { - // Arrange: Setup the source code that matches the generator input expectations. - const string sourceCode = """ - using System; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - using System.Reactive.Linq; - using System.Reactive.Subjects; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - private readonly Subject _testSubject = new(); - private readonly Subject _testNullableSubject = new(); - - public TestVM() - { - _pLCActiveHelper = _testSubject.ToProperty(this, nameof(PLCActive)); - _pLCNameHelper = _testNullableSubject.ToProperty(this, nameof(PLCName)); - } - - [ObservableAsProperty] - public partial string PLCActive { get; } - - [ObservableAsProperty] - public partial string? PLCName { get; } - } - """; - - // 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/OAPGeneratorTests.cs b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/OAPGeneratorTests.cs deleted file mode 100644 index bee6c2c0..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/UnitTests/OAPGeneratorTests.cs +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. -// ReactiveUI Association Incorporated licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. - -namespace ReactiveUI.SourceGenerator.Tests; - -/// Unit tests for the ObservableAsProperty generator. -public class OAPGeneratorTests : TestBase -{ - /// Tests that the source generator correctly generates observable properties. - /// A task to monitor the async. - [Test] - public Task FromField() - { - // Arrange: Setup the source code that matches the generator input expectations. - const string sourceCode = """ - using System; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - using System.Reactive.Linq; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty] - private int _test1 = 10; - } - """; - - // Act: Initialize the helper and run the generator. Assert: Verify the generated code. - return TestHelper.TestPass(sourceCode); - } - - /// Tests that the source generator correctly generates observable properties. - /// A task to monitor the async. - [Test] - public Task FromFieldNestedClass() - { - // Arrange: Setup the source code that matches the generator input expectations. - const string sourceCode = """ - using System; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - using System.Reactive.Linq; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty] - private int _test2 = 10; - - public partial class TestVMInner1 : ReactiveObject - { - [ObservableAsProperty] - private int _testIn1 = 10; - } - - public partial class TestVMInner2 : ReactiveObject - { - [ObservableAsProperty] - private int _testIn2 = 10; - - public partial class TestVMInner3 : ReactiveObject - { - [ObservableAsProperty] - private int _testIn3 = 10; - } - } - } - """; - - // Act: Initialize the helper and run the generator. Assert: Verify the generated code. - return TestHelper.TestPass(sourceCode); - } - - /// Tests that the source generator correctly generates observable properties. - /// A task to monitor the async. - [Test] - public Task NonReadOnlyFromField() - { - // Arrange: Setup the source code that matches the generator input expectations. - const string sourceCode = """ - using System; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - using System.Reactive.Linq; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty(ReadOnly = false)] - private int _test3 = 10; - } - """; - - // Act: Initialize the helper and run the generator. Assert: Verify the generated code. - return TestHelper.TestPass(sourceCode); - } - - /// Tests that the source generator correctly generates observable properties. - /// A task to monitor the async. - [Test] - public Task NamedFromField() - { - // Arrange: Setup the source code that matches the generator input expectations. - const string sourceCode = """ - using System; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - using System.Reactive.Linq; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty(PropertyName = "MyNamedProperty")] - private int _test4 = 10; - } - """; - - // Act: Initialize the helper and run the generator. Assert: Verify the generated code. - return TestHelper.TestPass(sourceCode); - } - - /// Tests that the source generator correctly generates observable properties. - /// A task to monitor the async. - [Test] - public Task NonReadOnlyFromFieldProtected() - { - // Arrange: Setup the source code that matches the generator input expectations. - const string sourceCode = """ - using System; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - using System.Reactive.Linq; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty(UseProtected = true)] - private int _test5 = 10; - } - """; - - // 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/OapExtTests.cs b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/OapExtTests.cs deleted file mode 100644 index 94176492..00000000 --- a/src/ReactiveUI.SourceGenerator.Tests/UnitTests/OapExtTests.cs +++ /dev/null @@ -1,641 +0,0 @@ -// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. -// ReactiveUI Association Incorporated licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. - -namespace ReactiveUI.SourceGenerator.Tests; - -/// Extended unit tests for the ObservableAsProperty generator covering edge cases. -public class OapExtTests : TestBase -{ - /// Tests ObservableAsProperty with initial value. - /// A task to monitor the async. - [Test] - public Task FromFieldWithInitialValue() - { - const string sourceCode = """ - using System; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - using System.Reactive.Linq; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty(InitialValue = "\"Loading...\"")] - private string _status = string.Empty; - } - """; - - return TestHelper.TestPass(sourceCode); - } - - /// Tests ObservableAsProperty with initial value for numeric type. - /// A task to monitor the async. - [Test] - public Task FromFieldWithNumericInitialValue() - { - const string sourceCode = """ - using System; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty(InitialValue = "-1")] - private int _count; - - [ObservableAsProperty(InitialValue = "0.0")] - private double _percentage; - } - """; - - return TestHelper.TestPass(sourceCode); - } - - /// Tests ObservableAsProperty with combined options. - /// A task to monitor the async. - [Test] - public Task FromFieldWithCombinedOptions() - { - const string sourceCode = """ - using System; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty(ReadOnly = false, UseProtected = true, PropertyName = "CustomStatus")] - private string _statusField = string.Empty; - } - """; - - return TestHelper.TestPass(sourceCode); - } - - /// Tests ObservableAsProperty with generic types. - /// A task to monitor the async. - [Test] - public Task FromFieldWithGenericTypes() - { - const string sourceCode = """ - using System; - using System.Collections.Generic; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty] - private List? _items; - - [ObservableAsProperty] - private Dictionary? _mappings; - - [ObservableAsProperty] - private IReadOnlyList? _numbers; - } - """; - - return TestHelper.TestPass(sourceCode); - } - - /// Tests ObservableAsProperty from observable property with generic type. - /// A task to monitor the async. - [Test] - public Task FromObservablePropertyWithGenericType() - { - const string sourceCode = """ - using System; - using System.Collections.Generic; - using System.Reactive.Linq; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty] - public IObservable> ItemsObservable => Observable.Return(new List()); - - [ObservableAsProperty] - public IObservable> MappingsObservable => - Observable.Return>(new Dictionary()); - } - """; - - return TestHelper.TestPass(sourceCode); - } - - /// Tests ObservableAsProperty with nullable types. - /// A task to monitor the async. - [Test] - public Task FromFieldWithNullableTypes() - { - const string sourceCode = """ - using System; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty] - private int? _nullableInt; - - [ObservableAsProperty] - private DateTime? _nullableDateTime; - - [ObservableAsProperty] - private Guid? _nullableGuid; - } - """; - - return TestHelper.TestPass(sourceCode); - } - - /// Tests ObservableAsProperty from observable method with parameters converted. - /// A task to monitor the async. - [Test] - public Task FromObservableMethodWithCustomName() - { - const string sourceCode = """ - using System; - using System.Reactive.Linq; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty(PropertyName = "IsLoading")] - public IObservable GetLoadingState() => Observable.Return(false); - - [ObservableAsProperty(PropertyName = "ErrorMessage")] - public IObservable GetError() => Observable.Return(null); - } - """; - - return TestHelper.TestPass(sourceCode); - } - - /// Tests ObservableAsProperty with tuple types. - /// A task to monitor the async. - [Test] - public Task FromFieldWithTupleTypes() - { - const string sourceCode = """ - using System; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty] - private (int Id, string Name)? _namedTuple; - - [ObservableAsProperty] - private ValueTuple _valueTuple; - } - """; - - return TestHelper.TestPass(sourceCode); - } - - /// Tests ObservableAsProperty from observable property with tuple. - /// A task to monitor the async. - [Test] - public Task FromObservablePropertyWithTuple() - { - const string sourceCode = """ - using System; - using System.Reactive.Linq; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty] - public IObservable<(bool Success, string Message)> ResultObservable => - Observable.Return((true, "Done")); - } - """; - - return TestHelper.TestPass(sourceCode); - } - - /// Tests ObservableAsProperty with array types. - /// A task to monitor the async. - [Test] - public Task FromFieldWithArrayTypes() - { - const string sourceCode = """ - using System; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty] - private byte[]? _bytes; - - [ObservableAsProperty] - private string[]? _strings; - - [ObservableAsProperty] - private int[][]? _jaggedArray; - } - """; - - return TestHelper.TestPass(sourceCode); - } - - /// Tests ObservableAsProperty in generic class. - /// A task to monitor the async. - [Test] - public Task FromFieldInGenericClass() - { - const string sourceCode = """ - using System; - using System.Reactive.Linq; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - public partial class GenericVM : ReactiveObject where T : class - { - [ObservableAsProperty] - private T? _item; - - [ObservableAsProperty] - public IObservable ItemObservable => Observable.Return(default); - } - """; - - return TestHelper.TestPass(sourceCode); - } - - /// Tests ObservableAsProperty with enum types. - /// A task to monitor the async. - [Test] - public Task FromFieldWithEnumTypes() - { - const string sourceCode = """ - using System; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - public enum Status { Pending, Active, Completed } - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty] - private Status _status; - - [ObservableAsProperty] - private Status? _nullableStatus; - } - """; - - return TestHelper.TestPass(sourceCode); - } - - /// Tests ObservableAsProperty from observable property with enum. - /// A task to monitor the async. - [Test] - public Task FromObservablePropertyWithEnum() - { - const string sourceCode = """ - using System; - using System.Reactive.Linq; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - public enum ConnectionState { Disconnected, Connecting, Connected } - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty] - public IObservable StateObservable => - Observable.Return(ConnectionState.Disconnected); - } - """; - - return TestHelper.TestPass(sourceCode); - } - - /// Tests multiple ObservableAsProperty in same class. - /// A task to monitor the async. - [Test] - public Task FromMultipleObservableAsProperties() - { - const string sourceCode = """ - using System; - using System.Reactive.Linq; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty] - private bool _isLoading; - - [ObservableAsProperty] - private string? _errorMessage; - - [ObservableAsProperty] - private int _itemCount; - - [ObservableAsProperty(UseProtected = true)] - private double _progress; - - [ObservableAsProperty(ReadOnly = false)] - private string _status = string.Empty; - - [ObservableAsProperty] - public IObservable HasItems => Observable.Return(true); - - [ObservableAsProperty] - public IObservable DisplayName() => Observable.Return("Test"); - } - """; - - return TestHelper.TestPass(sourceCode); - } - - /// Tests ObservableAsProperty in record class. - /// A task to monitor the async. - [Test] - public Task FromFieldInRecordClass() - { - const string sourceCode = """ - using System; - using System.Reactive.Linq; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - public partial record TestVMRecord : ReactiveObject - { - [ObservableAsProperty] - private string? _status; - - [ObservableAsProperty] - public IObservable CountObservable => Observable.Return(0); - } - """; - - return TestHelper.TestPass(sourceCode); - } - - /// Tests ObservableAsProperty with interface types. - /// A task to monitor the async. - [Test] - public Task FromFieldWithInterfaceTypes() - { - const string sourceCode = """ - using System; - using System.Collections.Generic; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - public interface IItem - { - string Name { get; } - } - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty] - private IItem? _currentItem; - - [ObservableAsProperty] - private IDisposable? _subscription; - - [ObservableAsProperty] - private IReadOnlyCollection? _allItems; - } - """; - - return TestHelper.TestPass(sourceCode); - } - - /// Tests ObservableAsProperty from observable property with interface. - /// A task to monitor the async. - [Test] - public Task FromObservablePropertyWithInterface() - { - const string sourceCode = """ - using System; - using System.Reactive.Linq; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - public interface IResult - { - bool Success { get; } - } - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty] - public IObservable ResultObservable => Observable.Return(null); - } - """; - - return TestHelper.TestPass(sourceCode); - } - - /// Tests ObservableAsProperty with TimeSpan and DateTimeOffset. - /// A task to monitor the async. - [Test] - public Task FromFieldWithTimeTypes() - { - const string sourceCode = """ - using System; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty] - private TimeSpan _elapsed; - - [ObservableAsProperty] - private DateTimeOffset _lastUpdated; - - [ObservableAsProperty] - private TimeSpan? _remainingTime; - } - """; - - return TestHelper.TestPass(sourceCode); - } - - /// Tests ObservableAsProperty in deeply nested class. - /// A task to monitor the async. - [Test] - public Task FromFieldInDeeplyNestedClass() - { - const string sourceCode = """ - using System; - using System.Reactive.Linq; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - public partial class Level1 : ReactiveObject - { - [ObservableAsProperty] - private int _level1Value; - - public partial class Level2 : ReactiveObject - { - [ObservableAsProperty] - private int _level2Value; - - [ObservableAsProperty] - public IObservable Level2Observable => Observable.Return("L2"); - - public partial class Level3 : ReactiveObject - { - [ObservableAsProperty] - private int _level3Value; - - public partial class Level4 : ReactiveObject - { - [ObservableAsProperty] - private int _level4Value; - - [ObservableAsProperty] - public IObservable DeepObservable => Observable.Return(true); - } - } - } - } - """; - - return TestHelper.TestPass(sourceCode); - } - - /// Tests ObservableAsProperty with delegate types. - /// A task to monitor the async. - [Test] - public Task FromFieldWithDelegateTypes() - { - const string sourceCode = """ - using System; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty] - private Func? _formatter; - - [ObservableAsProperty] - private Action? _callback; - - [ObservableAsProperty] - private EventHandler? _handler; - } - """; - - return TestHelper.TestPass(sourceCode); - } - - /// Tests ObservableAsProperty with attributes. - /// A task to monitor the async. - [Test] - public Task FromFieldWithAttributes() - { - const string sourceCode = """ - using System; - using System.Runtime.Serialization; - using System.Text.Json.Serialization; - using System.Reactive.Linq; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [property: JsonPropertyName("computed_value")] - [property: JsonInclude] - [DataMember(Name = "computedValue")] - [ObservableAsProperty] - private int _computedValue; - - [property: JsonIgnore] - [IgnoreDataMember] - [ObservableAsProperty] - public IObservable InternalState => Observable.Return("state"); - } - """; - - return TestHelper.TestPass(sourceCode); - } - - /// Tests ObservableAsProperty with complex nested generics from observable. - /// A task to monitor the async. - [Test] - public Task FromObservablePropertyWithComplexGenerics() - { - const string sourceCode = """ - using System; - using System.Collections.Generic; - using System.Reactive.Linq; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - public partial class TestVM : ReactiveObject - { - [ObservableAsProperty] - public IObservable>> ComplexDataObservable => - Observable.Return(new Dictionary>()); - - [ObservableAsProperty] - public IObservable>> NestedReadOnlyObservable => - Observable.Return>>( - new Dictionary>()); - } - """; - - return TestHelper.TestPass(sourceCode); - } -} diff --git a/src/ReactiveUI.SourceGenerator.Tests/UnitTests/ReactiveCollectionBehaviourTests.cs b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/ReactiveCollectionBehaviourTests.cs new file mode 100644 index 00000000..396e1bf7 --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/ReactiveCollectionBehaviourTests.cs @@ -0,0 +1,92 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System.Collections; +using System.ComponentModel; +using System.Reflection; +using System.Runtime.Loader; + +namespace ReactiveUI.SourceGenerator.Tests; + +/// Runs a generated [ReactiveCollection] property to check what its setter subscribes. +public class ReactiveCollectionBehaviourTests +{ + /// A view model with one generated collection property. + private const string Source = """ + using System.Collections.ObjectModel; + using ReactiveUI; + using ReactiveUI.SourceGenerators; + + namespace Behaviour; + + public partial class ViewModel : ReactiveObject + { + [ReactiveCollection] + private ObservableCollection? _items; + } + """; + + /// Replacing the collection unsubscribes the one it replaced, so only the current collection notifies. + /// A task to monitor the async. + [Test] + public async Task ReplacingTheCollectionUnsubscribesTheOldOne() + { + var (viewModel, property, collectionType) = CreateViewModel(); + var first = (IList)Activator.CreateInstance(collectionType)!; + var second = (IList)Activator.CreateInstance(collectionType)!; + var notifications = 0; + ((INotifyPropertyChanged)viewModel).PropertyChanged += (_, _) => notifications++; + + property.SetValue(viewModel, first); + property.SetValue(viewModel, second); + property.SetValue(viewModel, first); + property.SetValue(viewModel, second); + notifications = 0; + + _ = first.Add(1); + await Assert.That(notifications).IsEqualTo(0); + + _ = second.Add(1); + await Assert.That(notifications).IsEqualTo(1); + } + + /// Clearing a collection property that holds nothing does not throw. + /// A task to monitor the async. + [Test] + public async Task SettingNullWhenEmptyDoesNotThrow() + { + var (viewModel, property, _) = CreateViewModel(); + + await Assert.That(() => property.SetValue(viewModel, null)).ThrowsNothing(); + } + + /// Generates, compiles and loads the view model. + /// An instance, its generated collection property, and the collection type. + [System.Diagnostics.CodeAnalysis.SuppressMessage("Security", "SES1402", Justification = "The test loads the assembly it has just compiled from its own source.")] + private static (object ViewModel, PropertyInfo Property, Type CollectionType) CreateViewModel() + { + var parseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp13); + var compilation = CSharpCompilation.Create( + "ReactiveCollectionBehaviour", + [CSharpSyntaxTree.ParseText(Source, parseOptions)], + TestCompilationReferences.CreatePortableDefault(), + new(OutputKind.DynamicallyLinkedLibrary, nullableContextOptions: NullableContextOptions.Enable)); + _ = CSharpGeneratorDriver + .Create([new ReactiveGenerator().AsSourceGenerator(), new ReactiveCollectionGenerator().AsSourceGenerator()], parseOptions: parseOptions) + .RunGeneratorsAndUpdateCompilation(compilation, out var output, out _); + + using var image = new MemoryStream(); + var emit = output.Emit(image); + if (!emit.Success) + { + throw new InvalidOperationException(string.Join(Environment.NewLine, emit.Diagnostics)); + } + + image.Position = 0; + var assembly = new AssemblyLoadContext(nameof(ReactiveCollectionBehaviourTests), isCollectible: true).LoadFromStream(image); + var type = assembly.GetType("Behaviour.ViewModel", throwOnError: true)!; + var property = type.GetProperty("Items") ?? throw new InvalidOperationException("The Items property was not generated."); + return (Activator.CreateInstance(type)!, property, property.PropertyType); + } +} diff --git a/src/ReactiveUI.SourceGenerator.Tests/UnitTests/ReactiveUiIntegrationTests.cs b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/ReactiveUiIntegrationTests.cs index f36f95d5..49fb613d 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/UnitTests/ReactiveUiIntegrationTests.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/ReactiveUiIntegrationTests.cs @@ -259,66 +259,6 @@ public partial class ReactiveNameCollision : ReactiveObject } """; - /// Consumer source covering observable-as-property generation and rejection paths. - private const string ObservableAsPropertyOptionsSource = """ - using System; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace Compatibility; - - public partial class ObservableOptionsViewModel : ReactiveObject - { - [ObservableAsProperty(UseProtected = true, InitialValue = "42")] - public IObservable NumberStream => null!; - - [ObservableAsProperty(PropertyName = "Status", InitialValue = "ready")] - public IObservable StatusStream => null!; - - [ObservableAsProperty(PropertyName = "Computed", UseProtected = true)] - public IObservable Compute() => null!; - - [ObservableAsProperty] - public IObservable Maybe() => null!; - - [ObservableAsProperty] - public IObservable HasParameter(int value) => null!; - - [ObservableAsProperty] - public int NotObservable() => 0; - - [ObservableAsProperty] - public int OrdinaryProperty { get; set; } - - [ObservableAsProperty(ReadOnly = false, UseProtected = true, InitialValue = "7")] - public partial int PartialValue { get; } - - [ObservableAsProperty] - private int _defaultField; - - [ObservableAsProperty(UseProtected = true)] - private string? _nullableField; - - [ObservableAsProperty(ReadOnly = false)] - private int _mutableField = 1; - - [ObservableAsProperty] - private int Collision; - } - - public partial class InvalidObservableTarget - { - [ObservableAsProperty] - public IObservable InvalidProperty => null!; - - [ObservableAsProperty] - public IObservable InvalidMethod() => null!; - - [ObservableAsProperty] - private int _invalidField; - } - """; - /// Verifies this test project is executing against a real ReactiveUI 24-or-newer package. /// A task representing the asynchronous assertion work. [Test] @@ -490,28 +430,6 @@ public async Task ReactivePartialPropertiesCoverLanguageAndDiagnosticPaths() await Assert.That(GetDiagnosticIds(csharp13Diagnostics)).IsEquivalentTo(previewIds); } - /// Verifies observable-as-property options and rejected member shapes end to end. - /// A task representing the asynchronous assertion work. - [Test] - public async Task ObservableAsPropertyOptionsCoverGeneratedAndDiagnosticPaths() - { - var (_, generatedSource, diagnostics) = RunObservableAsPropertyGenerator(ObservableAsPropertyOptionsSource); - var diagnosticIds = GetDiagnosticIds(diagnostics); - - await Assert.That(generatedSource.Contains("protected ReactiveUI.ObservableAsPropertyHelper?", StringComparison.Ordinal)).IsTrue(); - await Assert.That(generatedSource.Contains("private string? _status = \"ready\";", StringComparison.Ordinal)).IsTrue(); - await Assert.That(generatedSource.Contains("public string? Status", StringComparison.Ordinal)).IsTrue(); - await Assert.That(generatedSource.Contains("Compute()!.ToProperty", StringComparison.Ordinal)).IsTrue(); - await Assert.That(generatedSource.Contains("NumberStream!.ToProperty", StringComparison.Ordinal)).IsTrue(); - await Assert.That(generatedSource.Contains("public partial int PartialValue", StringComparison.Ordinal)).IsTrue(); - await Assert.That(generatedSource.Contains("protected ReactiveUI.ObservableAsPropertyHelper? _partialValueHelper", StringComparison.Ordinal)).IsTrue(); - await Assert.That(generatedSource.Contains("private readonly ReactiveUI.ObservableAsPropertyHelper _defaultFieldHelper", StringComparison.Ordinal)).IsTrue(); - await Assert.That(generatedSource.Contains("private ReactiveUI.ObservableAsPropertyHelper? _mutableFieldHelper", StringComparison.Ordinal)).IsTrue(); - await Assert.That(diagnosticIds).Contains("RXUISG0009"); - await Assert.That(diagnosticIds).Contains("RXUISG0017"); - await Assert.That(diagnosticIds).Contains("RXUISG0018"); - } - /// Verifies that the ReactiveUI 24 System.Reactive variant selects its moved namespace. /// A task representing the asynchronous assertion work. [Test] @@ -721,7 +639,7 @@ public partial class ForwardingViewModel : ReactiveObject /// Verifies unresolved and nonconstant forwarded attribute expressions produce generator diagnostics. /// A task representing the asynchronous assertion work. [Test] - public async Task ObservableAsPropertyReportsInvalidForwardedAttributeForms() + public async Task ReactiveReportsInvalidForwardedAttributeForms() { const string source = """ using System; @@ -732,11 +650,11 @@ namespace Compatibility; public partial class InvalidForwardingViewModel : ReactiveObject { - [ObservableAsProperty] + [Reactive] [property: Missing] private int _missing; - [ObservableAsProperty] + [Reactive] [property: Obsolete(GetMessage())] private int _invalidExpression; @@ -744,7 +662,7 @@ public partial class InvalidForwardingViewModel : ReactiveObject } """; - var (_, _, diagnostics) = RunObservableAsPropertyGenerator(source); + var (_, _, diagnostics) = RunReactiveGenerator(source, LanguageVersion.Preview); var diagnosticIds = GetDiagnosticIds(diagnostics); await Assert.That(diagnosticIds).Contains("RXUISG0012"); @@ -956,18 +874,6 @@ private static (Compilation Compilation, string GeneratedSource, ImmutableArray< new ReactiveGenerator(), static hintName => hintName.EndsWith("Properties.g.cs", StringComparison.Ordinal)); - /// Runs the observable-as-property generator and collects its product sources. - /// The consumer source text. - /// The output compilation, generated source, and generator diagnostics. - private static (Compilation Compilation, string GeneratedSource, ImmutableArray Diagnostics) RunObservableAsPropertyGenerator( - string source) => - RunGenerator( - source, - LanguageVersion.Preview, - new ObservableAsPropertyGenerator(), - static hintName => hintName.EndsWith(".ObservableAsProperties.g.cs", StringComparison.Ordinal) - || hintName.EndsWith(".ObservableAsPropertyFromObservable.g.cs", StringComparison.Ordinal)); - /// Runs one incremental generator and collects selected generated sources. /// The consumer source text. /// The consumer language version. @@ -1024,11 +930,9 @@ private static string[] GetDiagnosticIds(ImmutableArray diagnostics) private static int CountOccurrences(string source, string value) { var count = 0; - var startIndex = 0; - while ((startIndex = source.IndexOf(value, startIndex, StringComparison.Ordinal)) >= 0) + for (var startIndex = source.IndexOf(value, StringComparison.Ordinal); startIndex >= 0; startIndex = source.IndexOf(value, startIndex + value.Length, StringComparison.Ordinal)) { count++; - startIndex += value.Length; } return count; diff --git a/src/ReactiveUI.SourceGenerator.Tests/UnitTests/RxObjExtTests.cs b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/RxObjExtTests.cs index 85fb3943..c2e277e6 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/UnitTests/RxObjExtTests.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/RxObjExtTests.cs @@ -67,31 +67,6 @@ public partial class ChildVM return TestHelper.TestPass(sourceCode); } - /// Tests ReactiveObject with ObservableAsProperty. - /// A task to monitor the async. - [Test] - public Task WithOap() - { - const string sourceCode = """ - using System; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - [IReactiveObject] - public partial class TestVM - { - [Reactive] - private string? _input; - - [ObservableAsProperty] - private string? _output; - } - """; - - return TestHelper.TestPass(sourceCode); - } - /// Tests ReactiveObject with generic type parameters. /// A task to monitor the async. [Test] diff --git a/src/ReactiveUI.SourceGenerator.Tests/UnitTests/SymbolExtensionTests.cs b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/SymbolExtensionTests.cs index ec3b3e85..3af49984 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/UnitTests/SymbolExtensionTests.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/SymbolExtensionTests.cs @@ -472,7 +472,7 @@ public class Derived : Base } """); - var derived = (INamedTypeSymbol)compilation.GetTypeByMetadataName(DerivedTypeMetadataName)!; + var derived = compilation.GetTypeByMetadataName(DerivedTypeMetadataName)!; var members = new List(); foreach (var member in derived.GetAllMembers()) { @@ -500,7 +500,7 @@ public class Derived : Base } """); - var derived = (INamedTypeSymbol)compilation.GetTypeByMetadataName(DerivedTypeMetadataName)!; + var derived = compilation.GetTypeByMetadataName(DerivedTypeMetadataName)!; List members = [.. derived.GetAllMembers("Shared")]; await Assert.That(members.Count).IsEqualTo(1); diff --git a/src/ReactiveUI.SourceGenerator.Tests/UnitTests/ViewApiIntegrationTests.cs b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/ViewApiIntegrationTests.cs new file mode 100644 index 00000000..2762e29f --- /dev/null +++ b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/ViewApiIntegrationTests.cs @@ -0,0 +1,257 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System.ComponentModel; +using System.Text; +using Microsoft.CodeAnalysis.Text; +using ReactiveUI.SourceGenerators.Extensions; +using ReactiveUI.SourceGenerators.Models; +using ReactiveUI.SourceGenerators.WinForms; + +namespace ReactiveUI.SourceGenerator.Tests; + +/// +/// Tests that the view generators name IViewFor and the view locator from the assembly the compilation uses: +/// ReactiveUI itself, ReactiveUI.Binding, or ReactiveUI.Binding.Reactive. +/// +public sealed class ViewApiIntegrationTests +{ + /// The lean ReactiveUI.Binding namespace. + private const string BindingNamespace = "ReactiveUI.Binding"; + + /// The System.Reactive-based ReactiveUI.Binding namespace. + private const string BindingReactiveNamespace = "ReactiveUI.Binding.Reactive"; + + /// Declares the IViewFor interfaces a ReactiveUI release not built on ReactiveUI.Binding ships. + private const string LegacyViewForSource = """ + namespace ReactiveUI + { + public interface IViewFor { object? ViewModel { get; set; } } + public interface IViewFor : IViewFor where T : class { new T? ViewModel { get; set; } } + } + """; + + /// Declares the command type only ReactiveUI.Reactive ships. + private const string ReactiveUIReactiveSource = """ + namespace ReactiveUI.Reactive + { + public static class ReactiveCommand { } + } + """; + + /// A Windows Forms view and a WPF view, each declared only through [IViewFor]. + private const string ViewsSource = """ + using ReactiveUI.SourceGenerators; + + namespace Views + { + public sealed class LoginViewModel { } + + [IViewFor] + public partial class FormsLoginView : System.Windows.Forms.UserControl { } + + [IViewFor("Views.LoginViewModel")] + public partial class WpfLoginView : System.Windows.Controls.UserControl { } + } + """; + + /// A Windows Forms routed host and view-model host. + private const string HostsSource = """ + using ReactiveUI.SourceGenerators.WinForms; + + namespace Hosts + { + [RoutedControlHost("System.Windows.Forms.UserControl")] + public partial class RoutedHost { } + + [ViewModelControlHost("System.Windows.Forms.UserControl")] + public partial class ViewModelHost { } + } + """; + + /// Verifies which assembly's view API is picked from each combination of references. + /// A task representing the asynchronous assertion work. + [Test] + public async Task ViewApiFollowsTheReferencedAssemblies() + { + await Assert.That(Detect()).IsEqualTo(ReactiveUiViewApi.ReactiveUI); + await Assert.That(Detect(LegacyViewForSource, BindingStub(BindingNamespace))).IsEqualTo(ReactiveUiViewApi.ReactiveUI); + await Assert.That(Detect(BindingStub(BindingNamespace))).IsEqualTo(ReactiveUiViewApi.Binding); + await Assert.That(Detect(BindingStub(BindingReactiveNamespace))).IsEqualTo(ReactiveUiViewApi.BindingReactive); + await Assert.That(Detect(BindingStub(BindingNamespace), BindingStub(BindingReactiveNamespace))).IsEqualTo(ReactiveUiViewApi.Binding); + await Assert.That(Detect(BindingStub(BindingNamespace), BindingStub(BindingReactiveNamespace), ReactiveUIReactiveSource)) + .IsEqualTo(ReactiveUiViewApi.BindingReactive); + } + + /// Verifies the qualified names each view API writes. + /// A task representing the asynchronous assertion work. + [Test] + public async Task ViewApiNamesTheInterfaceAndLocatorInFull() + { + var legacy = new ReactiveUiIntegration(ReactiveUiApi.Legacy, true); + var binding = legacy with { ViewApi = ReactiveUiViewApi.Binding }; + var bindingReactive = legacy with { ViewApi = ReactiveUiViewApi.BindingReactive }; + + await Assert.That(legacy.ViewNamespace).IsEqualTo("global::ReactiveUI"); + await Assert.That(legacy.CurrentViewLocator).IsEqualTo("global::ReactiveUI.ViewLocator.Current"); + await Assert.That(binding.ViewNamespace).IsEqualTo("global::ReactiveUI.Binding"); + await Assert.That(binding.CurrentViewLocator).IsEqualTo("global::ReactiveUI.Binding.ViewLocator.GetCurrent()"); + await Assert.That(bindingReactive.ViewNamespace).IsEqualTo("global::ReactiveUI.Binding.Reactive"); + await Assert.That(bindingReactive.CurrentViewLocator).IsEqualTo("global::ReactiveUI.Binding.Reactive.ViewLocator.GetCurrent()"); + } + + /// + /// Verifies [IViewFor] views implement ReactiveUI.Binding's interface and compile with no using for its + /// namespace, in each flavour. + /// + /// The ReactiveUI.Binding flavour's namespace. + /// A task representing the asynchronous assertion work. + [Test] + [Arguments(BindingNamespace)] + [Arguments(BindingReactiveNamespace)] + public async Task ViewsImplementTheBindingInterface(string bindingNamespace) + { + var (compilation, generated) = Run(ViewsSource, ".IViewFor.g.cs", BindingStub(bindingNamespace)); + + await Assert.That(GetErrors(compilation)).IsEmpty(); + await Assert.That(generated.Contains($": global::{bindingNamespace}.IViewFor", StringComparison.Ordinal)).IsTrue(); + await Assert.That(generated.Contains($"object? global::{bindingNamespace}.IViewFor.ViewModel", StringComparison.Ordinal)).IsTrue(); + await Assert.That(ImplementsViewFor(compilation, "Views.FormsLoginView", bindingNamespace)).IsTrue(); + await Assert.That(ImplementsViewFor(compilation, "Views.WpfLoginView", bindingNamespace)).IsTrue(); + } + + /// Verifies the Windows Forms hosts resolve views through ReactiveUI.Binding's view locator, in each flavour. + /// The ReactiveUI.Binding flavour's namespace. + /// A task representing the asynchronous assertion work. + [Test] + [Arguments(BindingNamespace)] + [Arguments(BindingReactiveNamespace)] + public async Task HostsUseTheBindingViewLocator(string bindingNamespace) + { + var (_, routed) = Run(HostsSource, ".RoutedControlHost.g.cs", BindingStub(bindingNamespace)); + var (_, viewModel) = Run(HostsSource, ".ViewModelControlHost.g.cs", BindingStub(bindingNamespace)); + + foreach (var generated in (string[])[routed, viewModel]) + { + await Assert.That(generated.Contains($"public global::{bindingNamespace}.IViewLocator? ViewLocator", StringComparison.Ordinal)).IsTrue(); + await Assert.That(generated.Contains($"ViewLocator ?? global::{bindingNamespace}.ViewLocator.GetCurrent();", StringComparison.Ordinal)).IsTrue(); + await Assert.That(generated.Contains("ReactiveUI.ViewLocator.Current", StringComparison.Ordinal)).IsFalse(); + } + + await Assert.That(viewModel.Contains($", IReactiveObject, global::{bindingNamespace}.IViewFor", StringComparison.Ordinal)).IsTrue(); + await Assert.That(viewModel.Contains($"_content as global::{bindingNamespace}.IViewFor;", StringComparison.Ordinal)).IsTrue(); + } + + /// Declares a ReactiveUI.Binding flavour's view interfaces and view locator. + /// The flavour's namespace. + /// The stub source. + private static string BindingStub(string bindingNamespace) => $$""" + namespace ReactiveUI + { + internal static class NamespaceMarker { } + } + + namespace {{bindingNamespace}} + { + public interface IViewFor { object? ViewModel { get; set; } } + public interface IViewFor : IViewFor where T : class { new T? ViewModel { get; set; } } + public interface IViewLocator { IViewFor? ResolveView(object? viewModel, string? contract = null); } + public static class ViewLocator { public static IViewLocator GetCurrent() => null!; } + } + """; + + /// Detects the view API of a compilation made of the given sources. + /// The sources declaring the referenced API surface. + /// The detected view API. + private static ReactiveUiViewApi Detect(params string[] sources) => + CreateCompilation(sources).GetReactiveUiIntegration().ViewApi; + + /// Runs one generator over a consumer source, the desktop stubs and a view API stub. + /// The generator to run. + /// The consumer source. + /// The suffix of the generated files to collect. + /// The view API stub. + /// The output compilation and the collected generated text. + private static (Compilation Compilation, string Generated) Run(string source, string hintSuffix, string stub) + where TGenerator : IIncrementalGenerator, new() + { + var compilation = CreateCompilation(source, TestCompilationReferences.WindowsDesktopStubs, stub); + GeneratorDriver driver = CSharpGeneratorDriver.Create([new TGenerator()]) + .WithUpdatedParseOptions((CSharpParseOptions)compilation.SyntaxTrees[0].Options); + driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var output, out _); + + var generated = new StringBuilder(); + foreach (var result in driver.GetRunResult().Results) + { + foreach (var file in result.GeneratedSources) + { + if (file.HintName.EndsWith(hintSuffix, StringComparison.Ordinal)) + { + _ = generated.AppendLine(file.SourceText.ToString()); + } + } + } + + return (output, generated.ToString()); + } + + /// Creates a compilation of the given sources against the core and component-model assemblies only. + /// The sources. + /// The compilation. + private static CSharpCompilation CreateCompilation(params string[] sources) + { + var parseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp13); + var trees = new SyntaxTree[sources.Length]; + for (var i = 0; i < sources.Length; i++) + { + trees[i] = CSharpSyntaxTree.ParseText(SourceText.From(sources[i], Encoding.UTF8), parseOptions, path: $"Source{i}.cs"); + } + + return CSharpCompilation.Create( + "ViewApiConsumer", + trees, + TestCompilationReferences.CreateForAssemblies( + typeof(object).Assembly, + typeof(Component).Assembly, + typeof(System.ComponentModel.CategoryAttribute).Assembly, + typeof(BindableAttribute).Assembly), + new(OutputKind.DynamicallyLinkedLibrary, nullableContextOptions: NullableContextOptions.Enable)); + } + + /// Checks that a view implements a flavour's IViewFor<T>. + /// The compilation after generation. + /// The view's metadata name. + /// The flavour's namespace. + /// when the view implements the flavour's interface. + private static bool ImplementsViewFor(Compilation compilation, string viewName, string bindingNamespace) + { + var viewFor = compilation.GetTypeByMetadataName($"{bindingNamespace}.IViewFor`1"); + foreach (var implemented in compilation.GetTypeByMetadataName(viewName)!.AllInterfaces) + { + if (SymbolEqualityComparer.Default.Equals(implemented.OriginalDefinition, viewFor)) + { + return true; + } + } + + return false; + } + + /// Formats all compilation errors for assertion output. + /// The compilation to inspect. + /// The formatted compilation errors. + private static string GetErrors(Compilation compilation) + { + var errors = new List(); + foreach (var diagnostic in compilation.GetDiagnostics()) + { + if (diagnostic.Severity == DiagnosticSeverity.Error) + { + errors.Add(diagnostic.ToString()); + } + } + + return string.Join(Environment.NewLine, errors); + } +} diff --git a/src/ReactiveUI.SourceGenerator.Tests/UnitTests/ViewForExtTests.cs b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/ViewForExtTests.cs index 98b5a9bc..41c8d7fa 100644 --- a/src/ReactiveUI.SourceGenerator.Tests/UnitTests/ViewForExtTests.cs +++ b/src/ReactiveUI.SourceGenerator.Tests/UnitTests/ViewForExtTests.cs @@ -7,120 +7,6 @@ namespace ReactiveUI.SourceGenerator.Tests; /// Extended unit tests for the IViewFor generator covering edge cases. public class ViewForExtTests : TestBase { - /// Tests IViewFor with LazySingleton registration type. - /// A task to monitor the async. - [Test] - public Task LazySingle() - { - const string sourceCode = """ - using System.Collections.ObjectModel; - using System.Windows; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - [IViewFor(RegistrationType = SplatRegistrationType.LazySingleton)] - public partial class TestView : Window - { - public TestView() => ViewModel = new TestViewModel(); - } - - public partial class TestViewModel : ReactiveObject - { - public int TestProperty { get; set; } - } - """; - - return TestHelper.TestPass(sourceCode); - } - - /// Tests IViewFor with Constant registration type. - /// A task to monitor the async. - [Test] - public Task Constant() - { - const string sourceCode = """ - using System.Collections.ObjectModel; - using System.Windows; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - [IViewFor(RegistrationType = SplatRegistrationType.Constant)] - public partial class TestView : Window - { - public TestView() => ViewModel = new TestViewModel(); - } - - public partial class TestViewModel : ReactiveObject - { - public string? Name { get; set; } - } - """; - - return TestHelper.TestPass(sourceCode); - } - - /// Tests IViewFor with PerRequest registration type. - /// A task to monitor the async. - [Test] - public Task PerReq() - { - const string sourceCode = """ - using System.Collections.ObjectModel; - using System.Windows; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - [IViewFor(RegistrationType = SplatRegistrationType.PerRequest)] - public partial class TestView : Window - { - public TestView() => ViewModel = new TestViewModel(); - } - - public partial class TestViewModel : ReactiveObject - { - public bool IsActive { get; set; } - } - """; - - return TestHelper.TestPass(sourceCode); - } - - /// Tests IViewFor with ViewModel registration. - /// A task to monitor the async. - [Test] - public Task FromIViewForWithViewModelRegistration() - { - const string sourceCode = """ - using System.Collections.ObjectModel; - using System.Windows; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - [IViewFor( - RegistrationType = SplatRegistrationType.LazySingleton, - ViewModelRegistrationType = SplatRegistrationType.LazySingleton)] - public partial class TestView : Window - { - public TestView() => ViewModel = new TestViewModel(); - } - - public partial class TestViewModel : ReactiveObject - { - public int Count { get; set; } - } - """; - - return TestHelper.TestPass(sourceCode); - } - /// Tests IViewFor with nested ViewModel. /// A task to monitor the async. [Test] @@ -257,7 +143,7 @@ public partial class View2 : Window public View2() => ViewModel = new ViewModel2(); } - [IViewFor(RegistrationType = SplatRegistrationType.LazySingleton)] + [IViewFor] public partial class View3 : Window { public View3() => ViewModel = new ViewModel3(); @@ -430,36 +316,6 @@ public partial class CommandsView : Window return TestHelper.TestPass(sourceCode); } - /// Tests IViewFor with all registration options. - /// A task to monitor the async. - [Test] - public Task AllRegOpts() - { - const string sourceCode = """ - using System.Collections.ObjectModel; - using System.Windows; - using ReactiveUI; - using ReactiveUI.SourceGenerators; - - namespace TestNs; - - public partial class FullViewModel - { - public string? Title { get; set; } - } - - [IViewFor( - RegistrationType = SplatRegistrationType.Constant, - ViewModelRegistrationType = SplatRegistrationType.PerRequest)] - public partial class FullView : Window - { - public FullView() => ViewModel = new FullViewModel(); - } - """; - - return TestHelper.TestPass(sourceCode); - } - /// Tests IViewFor with interface ViewModel type via string. /// A task to monitor the async. [Test] diff --git a/src/ReactiveUI.SourceGenerators.Analyzers.CodeFixes/Core/Generated/PolySharp.SourceGenerators/PolySharp.SourceGenerators.PolyfillsGenerator/System.Diagnostics.CodeAnalysis.NotNullWhenAttribute.g.cs b/src/ReactiveUI.SourceGenerators.Analyzers.CodeFixes/Core/Generated/PolySharp.SourceGenerators/PolySharp.SourceGenerators.PolyfillsGenerator/System.Diagnostics.CodeAnalysis.NotNullWhenAttribute.g.cs deleted file mode 100644 index 7c47fadc..00000000 --- a/src/ReactiveUI.SourceGenerators.Analyzers.CodeFixes/Core/Generated/PolySharp.SourceGenerators/PolySharp.SourceGenerators.PolyfillsGenerator/System.Diagnostics.CodeAnalysis.NotNullWhenAttribute.g.cs +++ /dev/null @@ -1,29 +0,0 @@ -// -#pragma warning disable -#nullable enable annotations - -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Diagnostics.CodeAnalysis -{ - /// - /// Specifies that when a method returns , the parameter will not be null even if the corresponding type allows it. - /// - [global::System.AttributeUsage(global::System.AttributeTargets.Parameter, Inherited = false)] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - internal sealed class NotNullWhenAttribute : global::System.Attribute - { - /// - /// Initializes the attribute with the specified return value condition. - /// - /// The return value condition. If the method returns this value, the associated parameter will not be null. - public NotNullWhenAttribute(bool returnValue) - { - ReturnValue = returnValue; - } - - /// Gets the return value condition. - public bool ReturnValue { get; } - } -} \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerators.Analyzers.CodeFixes/Core/Generated/PolySharp.SourceGenerators/PolySharp.SourceGenerators.PolyfillsGenerator/System.Diagnostics.CodeAnalysis.UnscopedRefAttribute.g.cs b/src/ReactiveUI.SourceGenerators.Analyzers.CodeFixes/Core/Generated/PolySharp.SourceGenerators/PolySharp.SourceGenerators.PolyfillsGenerator/System.Diagnostics.CodeAnalysis.UnscopedRefAttribute.g.cs deleted file mode 100644 index 9757fde2..00000000 --- a/src/ReactiveUI.SourceGenerators.Analyzers.CodeFixes/Core/Generated/PolySharp.SourceGenerators/PolySharp.SourceGenerators.PolyfillsGenerator/System.Diagnostics.CodeAnalysis.UnscopedRefAttribute.g.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -#pragma warning disable -#nullable enable annotations - -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Diagnostics.CodeAnalysis -{ - /// - /// Used to indicate a byref escapes and is not scoped. - /// - /// - /// - /// There are several cases where the C# compiler treats a as implicitly - /// - where the compiler does not allow the to escape the method. - /// - /// - /// For example: - /// - /// for instance methods. - /// parameters that refer to types. - /// parameters. - /// - /// - /// - /// This attribute is used in those instances where the should be allowed to escape. - /// - /// - /// Applying this attribute, in any form, has impact on consumers of the applicable API. It is necessary for - /// API authors to understand the lifetime implications of applying this attribute and how it may impact their users. - /// - /// - [global::System.AttributeUsage( - global::System.AttributeTargets.Method | - global::System.AttributeTargets.Property | - global::System.AttributeTargets.Parameter, - AllowMultiple = false, - Inherited = false)] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - internal sealed class UnscopedRefAttribute : global::System.Attribute - { - } -} \ No newline at end of file diff --git a/src/ReactiveUI.SourceGenerators.Analyzers.CodeFixes/ReactiveUI.SourceGenerators.Analyzers.CodeFixes.csproj b/src/ReactiveUI.SourceGenerators.Analyzers.CodeFixes/ReactiveUI.SourceGenerators.Analyzers.CodeFixes.csproj index 3b4f7c10..32c534a5 100644 --- a/src/ReactiveUI.SourceGenerators.Analyzers.CodeFixes/ReactiveUI.SourceGenerators.Analyzers.CodeFixes.csproj +++ b/src/ReactiveUI.SourceGenerators.Analyzers.CodeFixes/ReactiveUI.SourceGenerators.Analyzers.CodeFixes.csproj @@ -27,6 +27,10 @@ + + + + diff --git a/src/ReactiveUI.SourceGenerators.Execute.Maui/ReactiveUI.SourceGenerators.Execute.Maui.csproj b/src/ReactiveUI.SourceGenerators.Execute.Maui/ReactiveUI.SourceGenerators.Execute.Maui.csproj index d5950308..3488f4d9 100644 --- a/src/ReactiveUI.SourceGenerators.Execute.Maui/ReactiveUI.SourceGenerators.Execute.Maui.csproj +++ b/src/ReactiveUI.SourceGenerators.Execute.Maui/ReactiveUI.SourceGenerators.Execute.Maui.csproj @@ -8,6 +8,8 @@ false latest true + + $(NoWarn);SST1449 12.2 15.0 diff --git a/src/ReactiveUI.SourceGenerators.Execute.Maui/TestViewModel.cs b/src/ReactiveUI.SourceGenerators.Execute.Maui/TestViewModel.cs index 893af8f7..f1cf7f8e 100644 --- a/src/ReactiveUI.SourceGenerators.Execute.Maui/TestViewModel.cs +++ b/src/ReactiveUI.SourceGenerators.Execute.Maui/TestViewModel.cs @@ -34,11 +34,12 @@ public partial class TestViewModel : ReactiveObject /// Represents the duration of the cancellable sample command. private const int CancellableCommandDelayMilliseconds = 2_000; - /// Stores the observable-as-property sample value. - [JsonInclude] - [DataMember] - [ObservableAsProperty(ReadOnly = false)] - private double _test2Property; + /// Backs . + /// + /// [ObservableAsProperty] moved to ReactiveUI.Binding, so the helper is written by hand with ReactiveUI's + /// ToProperty. On ReactiveUI.Binding, mark a partial property [ObservableAsProperty] instead. + /// + private ObservableAsPropertyHelper? _test2PropertyHelper; /// Stores the reactive property sample value. [JsonInclude] @@ -52,6 +53,11 @@ public partial class TestViewModel : ReactiveObject /// Gets an observable that enables the first sample command. public IObservable CanExecuteTest1 => Observable.Return(_test1Property >= 0); + /// Gets the latest value the observable command produced. + [JsonInclude] + [DataMember] + public double Test2Property => _test2PropertyHelper?.Value ?? default; + /// Writes a message when the first generated command executes. [ReactiveCommand(CanExecute = nameof(CanExecuteTest1))] [property: JsonInclude] @@ -179,7 +185,6 @@ private void InitializeObservableProperty() _test2PropertyHelper = Test8ObservableCommand!.ToProperty(this, static viewModel => viewModel.Test2Property); _ = Test8ObservableCommand.Execute(ObservableCommandArgument).Subscribe(Console.Out.WriteLine); Console.Out.WriteLine($"Test2Property Value: {Test2Property}"); - Console.Out.WriteLine($"Test2Property underlying Value: {_test2Property}"); } /// Executes the cancellable and argument-taking generated commands. diff --git a/src/ReactiveUI.SourceGenerators.Execute/Program.cs b/src/ReactiveUI.SourceGenerators.Execute/Program.cs index 4ce9524f..3e84e7b4 100644 --- a/src/ReactiveUI.SourceGenerators.Execute/Program.cs +++ b/src/ReactiveUI.SourceGenerators.Execute/Program.cs @@ -3,7 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Diagnostics.CodeAnalysis; -using ReactiveUI.SourceGenerators; +using ReactiveUI; using Splat; namespace SGReactiveUI.SourceGenerators.Test; @@ -16,7 +16,10 @@ public static class Program [System.STAThread] public static void Main() { - AppLocator.CurrentMutable.RegisterViewsForViewModelsSourceGenerated(); + // The generated RegisterViewsForViewModelsSourceGenerated() is gone: ReactiveUI.Binding's view locator registers + // every IViewFor at compile time. Without ReactiveUI.Binding, register the views with Splat yourself. + AppLocator.CurrentMutable.Register>(static () => new TestViewWinForms()); + AppLocator.CurrentMutable.Register>>(static () => new TestViewWpf2()); Application.Run(new TestViewWinForms()); } } diff --git a/src/ReactiveUI.SourceGenerators.Execute/ReactiveUI.SourceGenerators.Execute.csproj b/src/ReactiveUI.SourceGenerators.Execute/ReactiveUI.SourceGenerators.Execute.csproj index 85dc8229..ddd367df 100644 --- a/src/ReactiveUI.SourceGenerators.Execute/ReactiveUI.SourceGenerators.Execute.csproj +++ b/src/ReactiveUI.SourceGenerators.Execute/ReactiveUI.SourceGenerators.Execute.csproj @@ -9,7 +9,8 @@ enable false preview - $(NoWarn);CA1812 + + $(NoWarn);CA1812;SST1449 true 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/TestClassOAPH_VM.cs b/src/ReactiveUI.SourceGenerators.Execute/TestClassOAPH_VM.cs index 83c47010..3829c13f 100644 --- a/src/ReactiveUI.SourceGenerators.Execute/TestClassOAPH_VM.cs +++ b/src/ReactiveUI.SourceGenerators.Execute/TestClassOAPH_VM.cs @@ -8,13 +8,23 @@ namespace SGReactiveUI.SourceGenerators.Test; -/// TestClassOAPH VM. +/// Read-only properties that follow reactive properties. +/// +/// [ObservableAsProperty] moved to ReactiveUI.Binding, so this sample writes each +/// by hand with ReactiveUI's ToProperty. On ReactiveUI.Binding, mark a +/// partial property [ObservableAsProperty] and the helper field is generated for you. +/// [ExcludeFromCodeCoverage] public partial class TestClassOAPH_VM : ReactiveObject { - /// Stores the observable boolean field. - [ObservableAsProperty] - private bool _observableTestField; + /// Backs . + private readonly ObservableAsPropertyHelper _observableTestPropertyHelper; + + /// Backs . + private readonly ObservableAsPropertyHelper _observableTestFieldHelper; + + /// Backs . + private readonly ObservableAsPropertyHelper _testHelper; /// Stores the reactive boolean field. [Reactive] @@ -37,14 +47,11 @@ public TestClassOAPH_VM() TestProperty = "Test2"; } - /// - /// Gets a value indicating whether [observable test property]. - /// - /// - /// true if [observable test property]; otherwise, false. - /// - [ObservableAsProperty] - public partial bool ObservableTestProperty { get; } + /// Gets a value indicating whether is set. + public bool ObservableTestProperty => _observableTestPropertyHelper.Value; + + /// Gets a value indicating whether is set. + public bool ObservableTestField => _observableTestFieldHelper.Value; /// /// Gets or sets a value indicating whether [reactive test property]. @@ -55,14 +62,8 @@ public TestClassOAPH_VM() [Reactive] public partial bool ReactiveTestProperty { get; set; } - /// - /// Gets the test. - /// - /// - /// The test. - /// - [ObservableAsProperty] - public partial string? Test { get; } + /// Gets the latest . + public string? Test => _testHelper.Value; /// Creates the helper that projects the reactive property to its observable counterpart. /// The initialized observable property helper. diff --git a/src/ReactiveUI.SourceGenerators.Execute/TestViewModel.Initialization.cs b/src/ReactiveUI.SourceGenerators.Execute/TestViewModel.Initialization.cs index d049a2c9..554e7b47 100644 --- a/src/ReactiveUI.SourceGenerators.Execute/TestViewModel.Initialization.cs +++ b/src/ReactiveUI.SourceGenerators.Execute/TestViewModel.Initialization.cs @@ -22,12 +22,12 @@ public partial class TestViewModel /// Creates the helper that projects the test command output. /// The initialized observable property helper. private ObservableAsPropertyHelper CreateTest2PropertyHelper() => - Test8ObservableCommand!.ToProperty(this, x => x.Test2Property); + Test8ObservableCommand!.ToProperty(this, x => x.Test2Property, initialValue: Test2InitialValue); /// Creates the helper that projects the activated reactive property. /// The initialized observable property helper. private ObservableAsPropertyHelper CreateTest11PropertyHelper() => - this.WhenAnyValue(x => x.Test12Property).ToProperty(this, x => x.Test11Property, out _); + this.WhenAnyValue(x => x.Test12Property).ToProperty(this, x => x.Test11Property, initialValue: Test11InitialValue); /// Creates the helper that projects the protected observable property. /// The initialized observable property helper. @@ -37,34 +37,59 @@ private ObservableAsPropertyHelper CreateObservableAsPropertyTest3Proper /// Creates the helper that projects the partial observable property. /// The initialized observable property helper. private ObservableAsPropertyHelper CreateObservableAsPropertyFromPropertyHelper() => - _fromPartialTestSubject.ToProperty(this, x => x.ObservableAsPropertyFromProperty); + _fromPartialTestSubject.ToProperty(this, x => x.ObservableAsPropertyFromProperty, initialValue: FromPropertyInitialValue); /// Creates the helper that projects the active PLC identifier. /// The initialized observable property helper. private ObservableAsPropertyHelper CreatePlcActiveHelper() => - this.WhenAnyValue(x => x.PartialRequiredPropertyTest).ToProperty(this, nameof(PLCActive)); + this.WhenAnyValue(x => x.PartialRequiredPropertyTest).ToProperty(this, nameof(PLCActive), initialValue: "Not Connected"); /// Creates the helper that projects the PLC status message. /// The initialized observable property helper. private ObservableAsPropertyHelper CreatePlcStatusHelper() => - this.WhenAnyValue(x => x.PLCActive).Select(static x => x ?? string.Empty).ToProperty(this, nameof(PLCStatus)); + this.WhenAnyValue(x => x.PLCActive).Select(static x => x ?? string.Empty).ToProperty(this, nameof(PLCStatus), initialValue: string.Empty); /// Creates the helper that projects the PLC port. /// The initialized observable property helper. private ObservableAsPropertyHelper CreatePlcPortHelper() => - this.WhenAnyValue(x => x.Test1Property).ToProperty(this, nameof(PLCPort)); + this.WhenAnyValue(x => x.Test1Property).ToProperty(this, nameof(PLCPort), initialValue: PlcInitialPort); /// Creates the helper that projects the PLC instance. /// The initialized observable property helper. private ObservableAsPropertyHelper CreatePlcInstanceHelper() => - this.WhenAnyValue(x => x.PlcInstanceCore).ToProperty(this, nameof(InstanceOfPLC)); + this.WhenAnyValue(x => x.PlcInstanceCore).ToProperty(this, nameof(InstanceOfPLC), initialValue: new()); + + /// Creates the helper that follows the non-null reference type observable. + /// The initialized observable property helper. + private ObservableAsPropertyHelper CreateReferenceTypeHelper() => + ReferenceTypeObservable.ToProperty(this, nameof(ReferenceTypeObservableProperty), initialValue: new()); + + /// Creates the helper that follows the nullable reference type observable. + /// The initialized observable property helper. + private ObservableAsPropertyHelper CreateNullableReferenceTypeHelper() => + NullableReferenceTypeObservable.ToProperty(this, nameof(NullableReferenceTypeObservableProperty)); + + /// Creates the helper that follows . + /// The initialized observable property helper. + private ObservableAsPropertyHelper CreateObservableAsPropertyTest2PropertyHelper() => + ObservableAsPropertyTest2.ToProperty(this, nameof(ObservableAsPropertyTest2Property), initialValue: ObservableAsPropertyInitialValue); + + /// Creates the helper that follows . + /// The initialized observable property helper. + private ObservableAsPropertyHelper CreateMyReadOnlyPropertyHelper() => + ObservableAsPropertyTest().ToProperty(this, nameof(MyReadOnlyProperty), initialValue: NegativeInitialReadOnlyValue); + + /// Creates the helper that follows . + /// The initialized observable property helper. + private ObservableAsPropertyHelper CreateMyReadOnlyNonNullPropertyHelper() => + ObservableAsPropertyTestNonNull().ToProperty(this, nameof(MyReadOnlyNonNullProperty), initialValue: NegativeNonNullReadOnlyValue); /// Registers the lifecycle activation subscriptions. private void RegisterActivation() => this.WhenActivated(disposables => { Console.Out.WriteLine("Activated"); - _test11PropertyHelper?.Dispose(); + _test11PropertyHelper.Dispose(); _test11PropertyHelper = CreateTest11PropertyHelper(); disposables(_test11PropertyHelper); disposables(GetDataCommand.Do(static _ => Console.Out.WriteLine("GetDataCommand Executed")).Subscribe()); @@ -75,17 +100,12 @@ private void RegisterActivation() => private void InitializeObservableProperties() { Console.Out.WriteLine("MyReadOnlyProperty before init"); - _myReadOnlyProperty = NegativeInitialReadOnlyValue; Console.Out.WriteLine(MyReadOnlyProperty); - Console.Out.WriteLine(_myReadOnlyProperty); Console.Out.WriteLine("MyReadOnlyNonNullProperty before init"); - _myReadOnlyNonNullProperty = NegativeNonNullReadOnlyValue; Console.Out.WriteLine(MyReadOnlyNonNullProperty); - Console.Out.WriteLine(_myReadOnlyNonNullProperty); - _observableAsPropertyTest2Property = ObservableAsPropertyInitialValue; Console.Out.WriteLine(ObservableAsPropertyTest2Property); - Console.Out.WriteLine(_observableAsPropertyTest2Property); - InitializeOAPH(); + Console.Out.WriteLine(ReferenceTypeObservableProperty); + Console.Out.WriteLine(NullableReferenceTypeObservableProperty); } /// Exercises the initial generated command set. @@ -111,7 +131,6 @@ private void ExerciseInitialCommands() Console.Out.WriteLine($"Test2Property default Value: {Test2Property}"); Test8ObservableCommand?.Execute(CommandArgumentValue).Subscribe(static d => Console.Out.WriteLine(d)); Console.Out.WriteLine($"Test2Property Value: {Test2Property}"); - Console.Out.WriteLine($"Test2Property underlying Value: {_test2Property}"); Console.Out.WriteLine(ObservableAsPropertyTest2Property); } @@ -119,28 +138,20 @@ private void ExerciseInitialCommands() private void ExerciseReadOnlyProperties() { Console.Out.WriteLine("MyReadOnlyProperty After Init"); - _myReadOnlyProperty = NegativeUpdatedReadOnlyValue; + _testSubject.OnNext(NegativeUpdatedReadOnlyValue); Console.Out.WriteLine(MyReadOnlyProperty); - Console.Out.WriteLine(_myReadOnlyProperty); _testSubject.OnNext(FirstObservedDoubleValue); Console.Out.WriteLine(MyReadOnlyProperty); - Console.Out.WriteLine(_myReadOnlyProperty); _testSubject.OnNext(null); Console.Out.WriteLine(MyReadOnlyProperty); - Console.Out.WriteLine(_myReadOnlyProperty); Console.Out.WriteLine("MyReadOnlyNonNullProperty After Init"); - _myReadOnlyNonNullProperty = NegativeUpdatedReadOnlyValue; + _testNonNullSubject.OnNext(NegativeUpdatedReadOnlyValue); Console.Out.WriteLine(MyReadOnlyNonNullProperty); - Console.Out.WriteLine(_myReadOnlyNonNullProperty); _testNonNullSubject.OnNext(SecondObservedDoubleValue); Console.Out.WriteLine(MyReadOnlyNonNullProperty); - Console.Out.WriteLine(_myReadOnlyNonNullProperty); _testNonNullSubject.OnNext(default); - Console.Out.WriteLine(_test13Property); Console.Out.WriteLine(Test13Property); - Console.Out.WriteLine(_test13PropertyHelper); Console.Out.WriteLine(MyReadOnlyNonNullProperty); - Console.Out.WriteLine(_myReadOnlyNonNullProperty); } /// Exercises the remaining commands and observable property updates. diff --git a/src/ReactiveUI.SourceGenerators.Execute/TestViewModel.cs b/src/ReactiveUI.SourceGenerators.Execute/TestViewModel.cs index a16c3995..566a4f06 100644 --- a/src/ReactiveUI.SourceGenerators.Execute/TestViewModel.cs +++ b/src/ReactiveUI.SourceGenerators.Execute/TestViewModel.cs @@ -58,6 +58,18 @@ public partial class TestViewModel : ReactiveObject, IActivatableViewModel, IDis /// Represents the cancellation delay in milliseconds. private const int CancellationDelayMilliseconds = 2_000; + /// Represents the initial value of . + private const double Test2InitialValue = 1.1D; + + /// Represents the initial value of and . + private const double Test11InitialValue = 11.1D; + + /// Represents the initial value of . + private const int PlcInitialPort = 9000; + + /// Represents the initial value of . + private const int FromPropertyInitialValue = 10; + /// Provides the observable used to control the private command. private readonly IObservable _observable = Observable.Return(true); @@ -73,23 +85,51 @@ public partial class TestViewModel : ReactiveObject, IActivatableViewModel, IDis /// Provides the scheduler used by generated reactive commands. private readonly IScheduler _scheduler = RxSchedulers.MainThreadScheduler; - /// Stores the first observable-as-property value. - [property: JsonInclude] - [DataMember] - [ObservableAsProperty] - private double? _test2Property = 1.1D; + // [ObservableAsProperty] moved to ReactiveUI.Binding. The read-only properties below are backed by + // ObservableAsPropertyHelper fields written by hand with ReactiveUI's ToProperty. On ReactiveUI.Binding, mark a + // partial property [ObservableAsProperty] and assign the generated _nameHelper field with ToProperty instead. + /// Backs . + private readonly ObservableAsPropertyHelper _test2PropertyHelper; + + /// Backs . + private readonly ObservableAsPropertyHelper _observableAsPropertyTest3PropertyHelper; + + /// Backs . + private readonly ObservableAsPropertyHelper _observableAsPropertyTest2PropertyHelper; + + /// Backs . + private readonly ObservableAsPropertyHelper _observableAsPropertyFromPropertyHelper; + + /// Backs . + private readonly ObservableAsPropertyHelper _plcActiveHelper; - /// Stores the second observable-as-property value. - [ObservableAsProperty(ReadOnly = false)] - private double? _test11Property = 11.1D; + /// Backs . + private readonly ObservableAsPropertyHelper _plcStatusHelper; - /// Stores the third observable-as-property value. - [ObservableAsProperty(ReadOnly = false)] - private double _test13Property = 11.1D; + /// Backs . + private readonly ObservableAsPropertyHelper _plcPortHelper; - /// Stores the protected observable-as-property value. - [ObservableAsProperty(UseProtected = true)] - private double _observableAsPropertyTest3Property; + /// Backs . + private readonly ObservableAsPropertyHelper _plcInstanceHelper; + + /// Backs . + private readonly ObservableAsPropertyHelper _referenceTypeObservablePropertyHelper; + + /// Backs . + private readonly ObservableAsPropertyHelper _nullableReferenceTypeObservablePropertyHelper; + + /// Backs . + private readonly ObservableAsPropertyHelper _myReadOnlyPropertyHelper; + + /// Backs . + private readonly ObservableAsPropertyHelper _myReadOnlyNonNullPropertyHelper; + + /// Backs ; replaced each time the view model activates. + private ObservableAsPropertyHelper _test11PropertyHelper; + + /// Stores the value follows. + [Reactive] + private double _test13Property = Test11InitialValue; /// Stores the value used by the reactive test property. [property: Test(AParameter = "Test Input")] @@ -149,13 +189,17 @@ public TestViewModel() _test2PropertyHelper = CreateTest2PropertyHelper(); _observableAsPropertyTest3PropertyHelper = CreateObservableAsPropertyTest3PropertyHelper(); _observableAsPropertyFromPropertyHelper = CreateObservableAsPropertyFromPropertyHelper(); - _pLCActiveHelper = CreatePlcActiveHelper(); - _pLCStatusHelper = CreatePlcStatusHelper(); - _pLCPortHelper = CreatePlcPortHelper(); - _instanceOfPLCHelper = CreatePlcInstanceHelper(); - _referenceTypeObservableProperty = default!; + _plcActiveHelper = CreatePlcActiveHelper(); + _plcStatusHelper = CreatePlcStatusHelper(); + _plcPortHelper = CreatePlcPortHelper(); + _plcInstanceHelper = CreatePlcInstanceHelper(); ReferenceTypeObservable = Observable.Return(new object()); - NullableReferenceTypeObservable = Observable.Return(new object()); + NullableReferenceTypeObservable = Observable.Return(null); + _referenceTypeObservablePropertyHelper = CreateReferenceTypeHelper(); + _nullableReferenceTypeObservablePropertyHelper = CreateNullableReferenceTypeHelper(); + _observableAsPropertyTest2PropertyHelper = CreateObservableAsPropertyTest2PropertyHelper(); + _myReadOnlyPropertyHelper = CreateMyReadOnlyPropertyHelper(); + _myReadOnlyNonNullPropertyHelper = CreateMyReadOnlyNonNullPropertyHelper(); RegisterActivation(); InitializeObservableProperties(); ExerciseInitialCommands(); @@ -245,45 +289,48 @@ public TestViewModel() /// /// The observable as property test2. /// - [ObservableAsProperty] - [property: Test(AParameter = "Test Input")] public IObservable ObservableAsPropertyTest2 => Observable.Return(DefaultObservableValue); - /// - /// Gets the current active PLC identifier or name. - /// - [ObservableAsProperty(InitialValue = "Not Connected")] - public partial string? PLCActive { get; } + /// Gets the latest value produced. + [Test(AParameter = "Test Input")] + public int ObservableAsPropertyTest2Property => _observableAsPropertyTest2PropertyHelper.Value; - /// - /// Gets the current PLC status message, initialized with an empty string. - /// - [ObservableAsProperty(InitialValue = "")] - public partial string PLCStatus { get; } + /// Gets the latest value produced. + [JsonInclude] + public double? Test2Property => _test2PropertyHelper.Value; - /// - /// Gets the TCP port number used to communicate with the PLC. - /// - [ObservableAsProperty(InitialValue = "9000")] - public partial int PLCPort { get; } + /// Gets the latest , following it while the view model is active. + public double? Test11Property => _test11PropertyHelper.Value; - /// - /// Gets the current instance of the PLC (Programmable Logic Controller) used by the application. - /// - [ObservableAsProperty(InitialValue = $"new {nameof(PLCInstance)}()")] - public partial PLCInstance InstanceOfPLC { get; } + /// Gets the latest . + public double ObservableAsPropertyTest3Property => _observableAsPropertyTest3PropertyHelper.Value; + + /// Gets the latest value produced. + public double? MyReadOnlyProperty => _myReadOnlyPropertyHelper.Value; + + /// Gets the latest value produced. + public double MyReadOnlyNonNullProperty => _myReadOnlyNonNullPropertyHelper.Value; + + /// Gets the current active PLC identifier or name. + public string? PLCActive => _plcActiveHelper.Value; + + /// Gets the current PLC status message, initialized with an empty string. + public string PLCStatus => _plcStatusHelper.Value; + + /// Gets the TCP port number used to communicate with the PLC. + public int PLCPort => _plcPortHelper.Value; + + /// Gets the current instance of the PLC (Programmable Logic Controller) used by the application. + public PLCInstance InstanceOfPLC => _plcInstanceHelper.Value; /// Gets the Activator which will be used by the View when Activation/Deactivation occurs. public ViewModelActivator Activator { get; } = new(); - /// - /// Gets the observable as property from property. - /// + /// Gets the observable as property from property. /// /// The observable as property from property. /// - [ObservableAsProperty(InitialValue = "10")] - public partial int ObservableAsPropertyFromProperty { get; } + public int ObservableAsPropertyFromProperty => _observableAsPropertyFromPropertyHelper.Value; /// /// Gets or sets the value for internal use within the partial class or assembly. @@ -291,24 +338,26 @@ public TestViewModel() [Reactive] internal partial int InternalPartialPropertyTest { get; set; } + /// Gets the latest value produced. + private object ReferenceTypeObservableProperty => _referenceTypeObservablePropertyHelper.Value; + + /// Gets the latest value produced. + private object? NullableReferenceTypeObservableProperty => _nullableReferenceTypeObservablePropertyHelper.Value; + /// Gets the observable used for the non-null reference type example. - [ObservableAsProperty] private IObservable ReferenceTypeObservable { get; } /// Gets the observable used for the nullable reference type example. - [ObservableAsProperty] private IObservable NullableReferenceTypeObservable { get; } /// Gets observables as property test. /// /// Observable of double. /// - [ObservableAsProperty(PropertyName = "MyReadOnlyProperty")] public IObservable ObservableAsPropertyTest() => _testSubject; /// Observables as property test non null. /// Observable of double. - [ObservableAsProperty(PropertyName = "MyReadOnlyNonNullProperty")] public IObservable ObservableAsPropertyTestNonNull() => _testNonNullSubject; /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. @@ -333,6 +382,19 @@ protected virtual void Dispose(bool disposing) _testSubject.Dispose(); _testNonNullSubject.Dispose(); _fromPartialTestSubject.Dispose(); + _test2PropertyHelper.Dispose(); + _test11PropertyHelper.Dispose(); + _observableAsPropertyTest2PropertyHelper.Dispose(); + _observableAsPropertyTest3PropertyHelper.Dispose(); + _observableAsPropertyFromPropertyHelper.Dispose(); + _plcActiveHelper.Dispose(); + _plcStatusHelper.Dispose(); + _plcPortHelper.Dispose(); + _plcInstanceHelper.Dispose(); + _referenceTypeObservablePropertyHelper.Dispose(); + _nullableReferenceTypeObservablePropertyHelper.Dispose(); + _myReadOnlyPropertyHelper.Dispose(); + _myReadOnlyNonNullPropertyHelper.Dispose(); } _disposedValue = true; diff --git a/src/ReactiveUI.SourceGenerators.Execute/TestViewWinForms.cs b/src/ReactiveUI.SourceGenerators.Execute/TestViewWinForms.cs index becab708..cb749090 100644 --- a/src/ReactiveUI.SourceGenerators.Execute/TestViewWinForms.cs +++ b/src/ReactiveUI.SourceGenerators.Execute/TestViewWinForms.cs @@ -8,7 +8,7 @@ namespace SGReactiveUI.SourceGenerators.Test; /// Provides the Windows Forms test view. /// -[IViewFor(RegistrationType = SplatRegistrationType.LazySingleton)] +[IViewFor] public partial class TestViewWinForms : Form { /// Initializes a new instance of the class. diff --git a/src/ReactiveUI.SourceGenerators.Execute/TestViewWinForms.resx b/src/ReactiveUI.SourceGenerators.Execute/TestViewWinForms.resx index 1af7de15..d58980a3 100644 --- a/src/ReactiveUI.SourceGenerators.Execute/TestViewWinForms.resx +++ b/src/ReactiveUI.SourceGenerators.Execute/TestViewWinForms.resx @@ -1,4 +1,4 @@ - + diff --git a/src/TestApps/TestMauiApplication/Platforms/Tizen/tizen-manifest.xml b/src/TestApps/TestMauiApplication/Platforms/Tizen/tizen-manifest.xml index 16035f2e..2f71da31 100644 --- a/src/TestApps/TestMauiApplication/Platforms/Tizen/tizen-manifest.xml +++ b/src/TestApps/TestMauiApplication/Platforms/Tizen/tizen-manifest.xml @@ -1,4 +1,4 @@ - + diff --git a/src/TestApps/TestMauiApplication/Platforms/Windows/App.xaml b/src/TestApps/TestMauiApplication/Platforms/Windows/App.xaml index 4cf22441..4bf3aaa4 100644 --- a/src/TestApps/TestMauiApplication/Platforms/Windows/App.xaml +++ b/src/TestApps/TestMauiApplication/Platforms/Windows/App.xaml @@ -1,4 +1,4 @@ - + + + + - net8.0-android;net8.0-ios;net8.0-maccatalyst - $(TargetFrameworks);net8.0-windows10.0.19041.0 + + $(MauiTfms) @@ -32,7 +32,7 @@ 11.0 13.1 - 21.0 + 23.0 10.0.17763.0 10.0.17763.0 6.5 @@ -64,7 +64,7 @@ - + diff --git a/src/TestApps/TestWpfApplication/App.xaml b/src/TestApps/TestWpfApplication/App.xaml index 2e70522d..6bd9b06c 100644 --- a/src/TestApps/TestWpfApplication/App.xaml +++ b/src/TestApps/TestWpfApplication/App.xaml @@ -1,4 +1,4 @@ - + + + + + 5.9.0 + + diff --git a/src/benchmarks/README.md b/src/benchmarks/README.md new file mode 100644 index 00000000..cadb3cbd --- /dev/null +++ b/src/benchmarks/README.md @@ -0,0 +1,111 @@ +# Generator benchmarks + +Two projects measure what the generators allocate: the generators while they run, and the code they generate while a +consumer's app runs it. Allocation is the figure to watch: it varies far less between runs than time does. + +| Project | Measures | +| --- | --- | +| `ReactiveUI.SourceGenerators.Benchmarks` | Generation: a cold run per generator's mock corpus, the whole corpus, and warm reruns after an edit. Also the attribute-discovery strategies against each other. | +| `ReactiveUI.SourceGenerators.Runtime.Benchmarks` | Generated code: a view model the generators write for, exercised as an app would. | + +## How allocations are measured + +Figures come from EventPipe, not BenchmarkDotNet's memory diagnoser. `--eventpipe ` runs each scenario a fixed +number of times inside an EventPipe session on its own process, with the runtime provider's GC keyword at verbose +level. The runtime raises a `GCAllocationTick` event about every 100 KB allocated, carrying the amount, the type and the +call stack. The sum of the amounts divided by the number of operations is the allocation per operation. Its sampling +error is about one tick over the whole session, so sessions run enough operations for that to be small. Each scenario's +trace is kept for breaking down by type and frame: + +```bash +cd src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks +dotnet run -c Release -- --smoke # every corpus generates and compiles; discovery strategies agree +dotnet run -c Release -- --eventpipe # generation scenarios +dotnet run -c Release -- --eventpipe-discovery # attribute discovery strategies +cd ../ReactiveUI.SourceGenerators.Runtime.Benchmarks +dotnet run -c Release -- --eventpipe # generated code +``` + +Each scenario writes `/.nettrace`. To see which frames allocate, open it in PerfView and use the +"GC Heap Alloc Ignore Free (Coarse Sampling) Stacks" view. + +The BenchmarkDotNet entry points remain for timings; they attach the same EventPipe profiler to each benchmark. + +The mock corpus repeats each mock file 20 times, each copy in its own namespace, and every corpus includes `Noise.cs`: +attributed code no generator acts on, so each generator's cost of looking past code that is not its own is counted. +A scenario builds its compilation once and reuses it, so after the warmup the compiler's own symbol caches are warm and +the figures isolate the generators and the driver. The incremental scenarios keep one warm driver and rerun it against +the same edited compilation, which is what one keystroke costs in the IDE. + +All figures are on .NET 10 (x64, Linux). + +## Results + +"Before" is the generators with `[ObservableAsProperty]` and view registration already removed, but still building +their output with interpolated strings, binding every attribute for `[IViewFor]` and `[IReactiveObject]`, and writing +every file from one collected output. It was measured with this same harness copied onto it. "After" is the generators +as they are now. + +### Generation + +| Scenario | Before, bytes/op | After, bytes/op | Change | +| --- | ---: | ---: | ---: | +| Cold, whole corpus | 17,330,975 | 11,636,366 | −32.9% | +| Cold, `[Reactive]` | 6,117,449 | 3,701,964 | −39.5% | +| Cold, `[ReactiveCommand]` | 2,849,862 | 1,764,827 | −38.1% | +| Cold, `[IReactiveObject]` | 2,851,598 | 1,542,311 | −45.9% | +| Cold, `[ReactiveCollection]` | 1,598,212 | 1,025,509 | −35.8% | +| Cold, `[IViewFor]` | 1,659,840 | 1,155,046 | −30.4% | +| Cold, `[BindableDerivedList]` | 1,142,445 | 952,705 | −16.6% | +| Cold, `[ViewModelControlHost]` | 1,168,922 | 1,166,055 | −0.2% | +| Cold, `[RoutedControlHost]` | 1,090,552 | 1,085,232 | −0.5% | +| Rerun after an unrelated edit | 8,984,317 | 7,838,332 | −12.8% | +| Rerun after editing a `[Reactive]` class's other members | 8,986,035 | 7,841,624 | −12.7% | +| Rerun after renaming a `[Reactive]` field | 10,990,885 | 7,986,248 | −27.3% | + +In the whole-corpus trace, `System.String` fell from 5.53 MB to 2.83 MB per run, and `StringBuilder` (0.80 MB) and +`char[]` (0.70 MB) dropped out of the top allocated types. What remains is mostly the compiler's own binding and the +driver's state tables. For the WinForms hosts, half of what they allocate is the generated file's own text, which is +the output itself, so their figures did not move. + +Where it came from, largest first: + +- Writing through the indentation-aware `SourceWriter` instead of nested raw strings, interpolation, `string.Join` and + `StringBuilder` fragments. +- `[IViewFor]` and `[IReactiveObject]` found their targets by binding every attribute of every attributed class; they + now use `ForAttributeWithMetadataName`. That path was 66% of the cold `[IViewFor]` corpus's allocations. +- `TargetInfo` built once per type symbol instead of once per member; metadata-name checks compared without building + names; `Task`/observable/scheduler checks compared structurally instead of building display strings; documentation + only requested when the declaration has a documentation comment; `[Reactive]`'s AlsoNotify fallback no longer + evaluates named arguments. +- Each type's file written from its own output: an edit that changes one type's models rewrites only that type's file. + +### Attribute discovery + +Three ways to find the 280 `[Reactive]` fields in the corpus, each in a generator that only discovers: + +| Strategy | Cold, bytes/op | Rerun after an unrelated edit, bytes/op | +| --- | ---: | ---: | +| `ForAttributeWithMetadataName` | 484,701 | 314,141 | +| Attribute simple name from syntax, then the symbol | 770,266 | 363,839 | +| Bind every attributed field and read its attributes | 875,872 | 437,790 | + +`ForAttributeWithMetadataName` allocates the least both cold and incrementally, so every generator uses it, with a +syntax predicate that rejects a node before any binding where the shape allows (for example, only `partial` classes for +`[IViewFor]` and `[IReactiveObject]`). + +### Generated code + +| Operation | Before, bytes/op | After, bytes/op | +| --- | ---: | ---: | +| Replace a `[ReactiveCollection]` property's collection | 355 | 70 | +| Add to and clear that collection, after 20,000 replacements | 640,392 | 161 | +| Set a `[Reactive]` property that also notifies another | 64 | 64 | +| Set a property of an `[IReactiveObject]` type | 32 | 32 | +| Read a `[ReactiveCommand]` command | 0 | 0 | + +The generated `[ReactiveCollection]` setter created a new handler for each subscribe and unsubscribe, so it never +unsubscribed anything: every replacement left another handler behind, each collection change raised a notification per +leaked handler, and the replacement itself grew slower as the handler list grew. It now keeps one handler per property. +The 64 and 32 bytes are ReactiveUI's own notification arguments, not generated code. The collection-replacement figures +rest on few allocation ticks (13 and 66), so they carry a sampling error of roughly 100 KB over 20,000 operations. diff --git a/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/GenerationBenchmarks.cs b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/GenerationBenchmarks.cs new file mode 100644 index 00000000..fec0ece8 --- /dev/null +++ b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/GenerationBenchmarks.cs @@ -0,0 +1,59 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using BenchmarkDotNet.Attributes; +using Microsoft.CodeAnalysis; +using ReactiveUI.SourceGenerators.Benchmarks.Support; + +namespace ReactiveUI.SourceGenerators.Benchmarks; + +/// Measures a cold generation pass over a mock consumer corpus. +/// +/// The driver is rebuilt per iteration so each measurement is a cold generation, which is what a consumer's build +/// pays. A reused driver would serve the next iteration from its incremental caches. +/// +public class GenerationBenchmarks +{ + /// How many times each mock file is repeated, each copy in its own namespace. + private const int Copies = 20; + + /// The mock consumer compilation, built once per parameter set. + private Compilation _compilation = null!; + + /// Gets the corpus names. + public static IEnumerable Corpora => GeneratorCatalog.Corpora; + + /// Gets or sets the corpus: one generator's mock file, or every mock file. + [ParamsSource(nameof(Corpora))] + public string Corpus { get; set; } = GeneratorHarness.AllCorpus; + + /// Builds the mock consumer compilation once per parameter set. + [GlobalSetup] + public void Setup() => _compilation = GeneratorHarness.BuildCompilation(Corpus, Copies); + + /// Runs a whole cold generation: syntax scan, extraction and emission. + /// The number of generated characters, so the work cannot be optimized away. + /// The corpus generated nothing beyond the injected attributes. + [Benchmark] + public int Generate() + { + var result = GeneratorHarness.CreateDriver(Corpus).RunGenerators(_compilation).GetRunResult(); + + var characters = 0; + var files = 0; + foreach (var generator in result.Results) + { + foreach (var generated in generator.GeneratedSources) + { + characters += generated.SourceText.Length; + files++; + } + } + + // A corpus that stopped matching the attributes would quietly measure driver overhead instead. + return files <= Copies + ? throw new InvalidOperationException($"The {Corpus} corpus generated {files} files; the benchmark is measuring nothing.") + : characters; + } +} diff --git a/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/BindableDerivedList.cs b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/BindableDerivedList.cs new file mode 100644 index 00000000..5afb35ca --- /dev/null +++ b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/BindableDerivedList.cs @@ -0,0 +1,17 @@ +using System.Collections.ObjectModel; +using ReactiveUI.Reactive; +using ReactiveUI.SourceGenerators; + +namespace Mocks.BindableDerivedList__N__; + +public partial class ListViewModel : ReactiveObject +{ + [BindableDerivedList] + private readonly ReadOnlyObservableCollection? _names; + + [BindableDerivedList(AccessModifier = PropertyAccessModifier.Internal)] + private readonly ReadOnlyObservableCollection? _numbers; + + [BindableDerivedList] + private readonly ReadOnlyObservableCollection? _children; +} diff --git a/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/IViewFor.cs b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/IViewFor.cs new file mode 100644 index 00000000..cc67792f --- /dev/null +++ b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/IViewFor.cs @@ -0,0 +1,27 @@ +using ReactiveUI.Reactive; +using ReactiveUI.SourceGenerators; + +namespace Mocks.IViewFor__N__; + +public sealed class LoginViewModel : ReactiveObject +{ +} + +public sealed class DashboardViewModel : ReactiveObject +{ +} + +[IViewFor] +public partial class LoginView : System.Windows.Controls.UserControl +{ +} + +[IViewFor] +public partial class DashboardView : System.Windows.Forms.UserControl +{ +} + +[IViewFor("Mocks.IViewFor__N__.LoginViewModel")] +public partial class LoginWindow : System.Windows.Window +{ +} diff --git a/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/Noise.cs b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/Noise.cs new file mode 100644 index 00000000..bbb06b57 --- /dev/null +++ b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/Noise.cs @@ -0,0 +1,74 @@ +using System; +using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +namespace Mocks.Noise__N__; + +// Code no generator acts on, with the attributes an application carries anyway. Every corpus includes it, so each +// generator's cost of looking past code that is not its own is measured. + +[Serializable] +[DataContract] +public partial class OrderDto +{ + [DataMember] + [JsonPropertyName("id")] + public int Id { get; set; } + + [DataMember] + [JsonPropertyName("customer")] + public string? Customer { get; set; } + + [Obsolete("Use Lines")] + [JsonIgnore] + public string? LegacyLines { get; set; } + + [Description("The order total")] + public decimal Total { get; set; } + + [ExcludeFromCodeCoverage] + public override string ToString() => Customer ?? string.Empty; +} + +[Description("A plain service")] +public sealed class OrderService +{ + [Obsolete("Use SaveAsync")] + public void Save(OrderDto order) => Validate(order); + + [ExcludeFromCodeCoverage] + private static void Validate(OrderDto order) => ArgumentNullException.ThrowIfNull(order); +} + +[DataContract] +public sealed record Address([property: DataMember] string Street, [property: DataMember] string City); + +[Flags] +public enum OrderState +{ + None = 0, + Placed = 1, + Shipped = 2, +} + +[Serializable] +public partial class Customer : INotifyPropertyChanged +{ + [NonSerialized] + private int _version; + + public event PropertyChangedEventHandler? PropertyChanged; + + [Browsable(false)] + public int Version + { + get => _version; + set + { + _version = value; + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Version))); + } + } +} diff --git a/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/Reactive.cs b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/Reactive.cs new file mode 100644 index 00000000..b940356d --- /dev/null +++ b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/Reactive.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using ReactiveUI.Reactive; +using ReactiveUI.SourceGenerators; + +namespace Mocks.Reactive__N__; + +/// A view model with field and partial-property reactive members. +public partial class PersonViewModel : ReactiveObject +{ + [Reactive] + private string _firstName = string.Empty; + + [Reactive(nameof(FullName))] + private string _lastName = string.Empty; + + [Reactive(SetModifier = AccessModifier.Protected)] + private int _age; + + [Reactive(Inheritance = InheritanceModifier.Virtual)] + private double? _height; + + [Reactive] + private List? _tags; + + [Reactive] + private DateTimeOffset _updated; + + public string FullName => FirstName + " " + LastName; + + /// Gets or sets the nickname. + [Reactive] + public partial string? Nickname { get; set; } + + [Reactive] + public partial int Score { get; protected set; } + + [Reactive("Summary")] + public partial bool IsActive { get; set; } + + public string Summary => IsActive ? FullName : string.Empty; +} + +public partial class AddressViewModel : ReactiveObject +{ + [Reactive] + private string? _street; + + [Reactive] + private string? _city; + + [Reactive] + private string? _postCode; + + [Reactive] + public partial string? Country { get; set; } + + public partial class Nested : ReactiveObject + { + [Reactive] + private int _level; + } +} + +public partial class GenericViewModel : ReactiveObject + where T : class +{ + [Reactive] + private T? _value; + + [Reactive] + public partial IReadOnlyList? Items { get; set; } +} diff --git a/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/ReactiveCollection.cs b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/ReactiveCollection.cs new file mode 100644 index 00000000..4da0bbcd --- /dev/null +++ b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/ReactiveCollection.cs @@ -0,0 +1,17 @@ +using System.Collections.ObjectModel; +using ReactiveUI.Reactive; +using ReactiveUI.SourceGenerators; + +namespace Mocks.ReactiveCollection__N__; + +public partial class CollectionViewModel : ReactiveObject +{ + [ReactiveCollection] + private ObservableCollection _names = []; + + [ReactiveCollection] + private ObservableCollection _numbers = []; + + [ReactiveCollection] + private ObservableCollection? _children; +} diff --git a/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/ReactiveCommand.cs b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/ReactiveCommand.cs new file mode 100644 index 00000000..75a4b6fb --- /dev/null +++ b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/ReactiveCommand.cs @@ -0,0 +1,42 @@ +using System; +using System.Reactive.Linq; +using System.Threading; +using System.Threading.Tasks; +using ReactiveUI.Reactive; +using ReactiveUI.SourceGenerators; + +namespace Mocks.ReactiveCommand__N__; + +public partial class CommandsViewModel : ReactiveObject +{ + private readonly IObservable _canSave = Observable.Return(true); + + [ReactiveCommand] + private void Refresh() + { + } + + [ReactiveCommand] + private int Add(int value) => value + 1; + + [ReactiveCommand(CanExecute = nameof(_canSave))] + private Task SaveAsync() => Task.CompletedTask; + + [ReactiveCommand] + private Task LoadAsync(string key, CancellationToken token) => Task.FromResult(key); + + [ReactiveCommand] + private IObservable Stream(double seed) => Observable.Return(seed); + + [ReactiveCommand(OutputScheduler = "RxSchedulers.MainThreadScheduler")] + private string Format(int value) => value.ToString(); + + [ReactiveCommand(AccessModifier = PropertyAccessModifier.Internal)] + private void Reset() + { + } + + [ReactiveCommand] + [property: System.ComponentModel.Description("delete")] + private async Task DeleteAsync(int id, CancellationToken token) => await Task.Delay(id, token); +} diff --git a/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/ReactiveObject.cs b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/ReactiveObject.cs new file mode 100644 index 00000000..d30ebe7c --- /dev/null +++ b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/ReactiveObject.cs @@ -0,0 +1,24 @@ +using System.ComponentModel; +using ReactiveUI.SourceGenerators; + +namespace Mocks.ReactiveObject__N__; + +[IReactiveObject] +public partial class PlainObject +{ + [Reactive] + private string? _name; + + [Reactive] + private int _count; + + [Reactive] + public partial bool Enabled { get; set; } +} + +[IReactiveObject] +public partial class Settings +{ + [Reactive] + private double _volume; +} diff --git a/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/RoutedControlHost.cs b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/RoutedControlHost.cs new file mode 100644 index 00000000..a555429e --- /dev/null +++ b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/RoutedControlHost.cs @@ -0,0 +1,14 @@ +using System.ComponentModel; +using ReactiveUI.SourceGenerators.WinForms; + +namespace Mocks.RoutedControlHost__N__; + +[RoutedControlHost("System.Windows.Forms.UserControl")] +public partial class RouterControl +{ + private IContainer? components; + + private void InitializeComponent() + { + } +} diff --git a/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/Stubs.cs b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/Stubs.cs new file mode 100644 index 00000000..1ec676ff --- /dev/null +++ b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/Stubs.cs @@ -0,0 +1,64 @@ +// Stand-ins for the WPF and WinForms types the view mocks derive from, so the corpus compiles on every OS. +namespace System.Windows +{ + public class DependencyProperty + { + public static DependencyProperty Register(string name, global::System.Type propertyType, global::System.Type ownerType, PropertyMetadata typeMetadata) => null!; + } + public class PropertyMetadata + { + public PropertyMetadata(object? defaultValue) { } + } + public class DependencyObject + { + public object GetValue(DependencyProperty dp) => null!; + public void SetValue(DependencyProperty dp, object value) { } + } + public class UIElement : DependencyObject { } + public class FrameworkElement : UIElement { } + public class Window : FrameworkElement { } +} +namespace System.Windows.Controls +{ + public class UserControl : System.Windows.FrameworkElement { } + public class Page : System.Windows.FrameworkElement { } +} +namespace System.Windows.Forms +{ + public enum DockStyle + { + None, + Fill, + } + + public class Control : global::System.ComponentModel.Component + { + public ControlCollection Controls { get; } = new(); + public DockStyle Dock { get; set; } + public void SuspendLayout() { } + public void ResumeLayout() { } + } + + public sealed class ControlCollection : global::System.Collections.Generic.IEnumerable + { + private readonly global::System.Collections.Generic.List controls = new(); + + public int Count => controls.Count; + public void Add(Control control) => controls.Add(control); + public void Clear() => controls.Clear(); + public void Remove(Control? control) + { + if (control is not null) + { + controls.Remove(control); + } + } + + public global::System.Collections.Generic.IEnumerator GetEnumerator() => controls.GetEnumerator(); + global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() => GetEnumerator(); + } + + public class Form : Control { } + public class UserControl : Control { } +} + diff --git a/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/ViewModelControlHost.cs b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/ViewModelControlHost.cs new file mode 100644 index 00000000..e0df9504 --- /dev/null +++ b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Mocks/ViewModelControlHost.cs @@ -0,0 +1,14 @@ +using System.ComponentModel; +using ReactiveUI.SourceGenerators.WinForms; + +namespace Mocks.ViewModelControlHost__N__; + +[ViewModelControlHost("System.Windows.Forms.UserControl")] +public partial class HostControl +{ + private IContainer? components; + + private void InitializeComponent() + { + } +} diff --git a/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Program.cs b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Program.cs new file mode 100644 index 00000000..2516a77f --- /dev/null +++ b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Program.cs @@ -0,0 +1,83 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System.Diagnostics.Tracing; +using BenchmarkDotNet.Configs; +using BenchmarkDotNet.Diagnosers; +using BenchmarkDotNet.Running; +using Microsoft.Diagnostics.NETCore.Client; +using Microsoft.Diagnostics.Tracing.Parsers; +using ReactiveUI.SourceGenerators.Benchmarks.Shared; +using ReactiveUI.SourceGenerators.Benchmarks.Support; + +namespace ReactiveUI.SourceGenerators.Benchmarks; + +/// Entry point that hands the command line to the BenchmarkDotNet switcher. +internal static class Program +{ + /// The environment variable that turns the EventPipe profiler off when set to false. + private const string ProfilersVariable = "BENCHMARK_PROFILERS"; + + /// Runs the benchmarks the command line selects, --smoke to run each corpus once, or --eventpipe dir to trace allocations. + /// The command-line arguments. + internal static void Main(string[] args) + { + if (args is ["--eventpipe", var outputDirectory]) + { + // Allocation figures: GCAllocationTick events from an EventPipe session over a fixed number of runs. + _ = EventPipeAllocations.Measure(GenerationScenarios.Create(), outputDirectory); + return; + } + + if (args is ["--eventpipe-discovery", var discoveryDirectory]) + { + // Attribute discovery strategies against each other, measured the same way. + _ = EventPipeAllocations.Measure(DiscoveryScenarios.Create(), discoveryDirectory); + return; + } + + if (args is ["--smoke"]) + { + // Runs each corpus once outside BenchmarkDotNet, to prove the mocks still generate before a long run. + foreach (var corpus in GeneratorCatalog.Corpora) + { + var benchmark = new GenerationBenchmarks { Corpus = corpus }; + benchmark.Setup(); + Console.WriteLine($"{corpus}: {benchmark.Generate():N0} characters, {GeneratorHarness.CountErrors(corpus)} compile errors"); + } + + foreach (var finding in DiscoveryScenarios.DescribeFindings()) + { + Console.WriteLine(finding); + } + + return; + } + + _ = BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, CreateConfig()); + } + + /// Creates the run configuration. + /// An EventPipe trace per benchmark unless profiling is turned off; allocation figures come from its GC events. + /// + /// The trace carries verbose GC events, whose AllocationTick events name the allocated type and its call stack, + /// and CPU samples. The traces land in BenchmarkDotNet.Artifacts and can be opened in PerfView. + /// + private static ManualConfig CreateConfig() + { + var config = ManualConfig.Create(DefaultConfig.Instance); + if (string.Equals(Environment.GetEnvironmentVariable(ProfilersVariable), "false", StringComparison.OrdinalIgnoreCase)) + { + return config; + } + + EventPipeProvider[] providers = + [ + new("Microsoft-DotNETCore-SampleProfiler", EventLevel.Informational), + new(ClrTraceEventParser.ProviderName, EventLevel.Verbose, (long)(ClrTraceEventParser.Keywords.Default | ClrTraceEventParser.Keywords.GCHandle)), + ]; + + return config.AddDiagnoser(new EventPipeProfiler(EventPipeProfile.GcVerbose, providers)); + } +} diff --git a/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/ReactiveUI.SourceGenerators.Benchmarks.csproj b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/ReactiveUI.SourceGenerators.Benchmarks.csproj new file mode 100644 index 00000000..57f72e22 --- /dev/null +++ b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/ReactiveUI.SourceGenerators.Benchmarks.csproj @@ -0,0 +1,38 @@ + + + + net10.0 + Exe + false + enable + enable + + $(NoWarn);CA1515;CA1822;CA1001 + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Support/DiscoveryGenerators.cs b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Support/DiscoveryGenerators.cs new file mode 100644 index 00000000..c13e4ec8 --- /dev/null +++ b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Support/DiscoveryGenerators.cs @@ -0,0 +1,122 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp.Syntax; + +namespace ReactiveUI.SourceGenerators.Benchmarks.Support; + +/// Three ways to find the fields marked [Reactive], measured against each other. +/// +/// Each generator only discovers: its transform reads the field's name and its output counts the fields, so the +/// measurement is the cost of finding the targets and nothing else. +/// +internal static class DiscoveryGenerators +{ + /// The attribute every strategy looks for. + private const string AttributeMetadataName = "ReactiveUI.SourceGenerators.ReactiveAttribute"; + + /// Gets the strategies by name. + internal static IReadOnlyList<(string Name, IIncrementalGenerator Generator)> Strategies { get; } = + [ + ("ForAttributeWithMetadataName", new ForAttributeWithMetadataNameDiscovery()), + ("SyntaxNameThenSymbol", new SyntaxNameThenSymbolDiscovery()), + ("DeclaredSymbolScan", new DeclaredSymbolScanDiscovery()), + ]; + + /// Determines from syntax whether a declarator belongs to a field that carries attributes. + /// The node. + /// Whether the node is a variable of an attributed field. + private static bool IsAttributedField(SyntaxNode node) => + node is VariableDeclaratorSyntax { Parent.Parent: FieldDeclarationSyntax { AttributeLists.Count: > 0 } }; + + /// Determines whether a symbol carries the attribute, comparing its class's metadata name. + /// The symbol. + /// Whether the attribute is present. + private static bool HasReactiveAttribute(ISymbol symbol) + { + foreach (var attribute in symbol.GetAttributes()) + { + if (attribute.AttributeClass?.ToDisplayString() == AttributeMetadataName) + { + return true; + } + } + + return false; + } + + /// Writes the number of fields found, so every strategy's pipeline runs to its end. + /// The generator initialization context. + /// The names of the fields found. + private static void RegisterCount(in IncrementalGeneratorInitializationContext context, IncrementalValuesProvider names) => + context.RegisterSourceOutput(names.Collect(), static (context, all) => context.AddSource("Count.g.cs", $"// {all.Length}")); + + /// Finds the fields with ForAttributeWithMetadataName. + private sealed class ForAttributeWithMetadataNameDiscovery : IIncrementalGenerator + { + /// + public void Initialize(IncrementalGeneratorInitializationContext context) => + RegisterCount(context, context.SyntaxProvider.ForAttributeWithMetadataName( + AttributeMetadataName, + static (node, _) => IsAttributedField(node), + static (context, _) => context.TargetSymbol.Name)); + } + + /// Finds the fields by the attribute's simple name in syntax, then confirms the attribute on the symbol. + private sealed class SyntaxNameThenSymbolDiscovery : IIncrementalGenerator + { + /// + public void Initialize(IncrementalGeneratorInitializationContext context) => + RegisterCount(context, context.SyntaxProvider.CreateSyntaxProvider( + static (node, _) => NamesReactiveAttribute(node), + static (context, token) => context.SemanticModel.GetDeclaredSymbol(context.Node, token) is { } symbol && HasReactiveAttribute(symbol) ? symbol.Name : null) + .Where(static name => name is not null) + .Select(static (name, _) => name!)); + + /// Determines from syntax alone whether a field names an attribute Reactive or ReactiveAttribute. + /// The node. + /// Whether any attribute's simple name matches. + private static bool NamesReactiveAttribute(SyntaxNode node) + { + if (node is not VariableDeclaratorSyntax { Parent.Parent: FieldDeclarationSyntax field }) + { + return false; + } + + foreach (var list in field.AttributeLists) + { + foreach (var attribute in list.Attributes) + { + var name = attribute.Name switch + { + QualifiedNameSyntax qualified => qualified.Right.Identifier.ValueText, + AliasQualifiedNameSyntax alias => alias.Name.Identifier.ValueText, + SimpleNameSyntax simple => simple.Identifier.ValueText, + _ => string.Empty, + }; + + if (name is "Reactive" or "ReactiveAttribute") + { + return true; + } + } + } + + return false; + } + } + + /// Finds the fields by binding every attributed field and reading its attributes, as the old IViewFor helper did for classes. + private sealed class DeclaredSymbolScanDiscovery : IIncrementalGenerator + { + /// + public void Initialize(IncrementalGeneratorInitializationContext context) => + RegisterCount(context, context.SyntaxProvider.CreateSyntaxProvider( + static (node, _) => IsAttributedField(node), + static (context, token) => context.SemanticModel.GetDeclaredSymbol(context.Node, token) is { } symbol && HasReactiveAttribute(symbol) ? symbol.Name : null) + .Where(static name => name is not null) + .Select(static (name, _) => name!)); + } +} diff --git a/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Support/DiscoveryScenarios.cs b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Support/DiscoveryScenarios.cs new file mode 100644 index 00000000..8b9272ad --- /dev/null +++ b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Support/DiscoveryScenarios.cs @@ -0,0 +1,110 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using ReactiveUI.SourceGenerators.Benchmarks.Shared; + +namespace ReactiveUI.SourceGenerators.Benchmarks.Support; + +/// The attribute-discovery scenarios: each strategy cold, and rerun after an unrelated edit. +internal static class DiscoveryScenarios +{ + /// How many times each mock file is repeated. + private const int Copies = 20; + + /// The operations a cold session runs. + private const int ColdOperations = 100; + + /// The operations an incremental session runs. + private const int IncrementalOperations = 400; + + /// The text the unrelated edit changes. + private const string UnrelatedEditTarget = "public override string ToString() => Customer ?? string.Empty;"; + + /// Creates a cold and an incremental scenario per discovery strategy. + /// The scenarios. + internal static List Create() + { + // Every generator's output joins the corpus first, so the attributes resolve and the generated files add the + // kind of code a real build carries alongside the consumer's. + Compilation compilation = null!; + Compilation edited = null!; + void Prepare() + { + if (compilation is not null) + { + return; + } + + _ = GeneratorHarness.CreateDriver(GeneratorHarness.AllCorpus) + .RunGeneratorsAndUpdateCompilation(GeneratorHarness.BuildCompilation(GeneratorHarness.AllCorpus, Copies), out compilation, out _); + var tree = FindTree(compilation, "Noise0.cs"); + var text = tree.GetText().ToString().Replace(UnrelatedEditTarget, "public override string ToString() => Customer ?? \"none\";", StringComparison.Ordinal); + edited = compilation.ReplaceSyntaxTree(tree, tree.WithChangedText(Microsoft.CodeAnalysis.Text.SourceText.From(text))); + } + + var scenarios = new List(); + foreach (var (name, generator) in DiscoveryGenerators.Strategies) + { + scenarios.Add(new($"Discovery-Cold-{name}", ColdOperations, Prepare, () => Run(CreateDriver(generator), compilation))); + + GeneratorDriver warm = null!; + scenarios.Add(new( + $"Discovery-Incremental-{name}", + IncrementalOperations, + () => + { + Prepare(); + warm = CreateDriver(generator).RunGenerators(compilation); + }, + () => Run(warm, edited))); + } + + return scenarios; + } + + /// Runs each strategy once and reports what it found, to show they agree. + /// One line per strategy. + internal static IEnumerable DescribeFindings() + { + _ = GeneratorHarness.CreateDriver(GeneratorHarness.AllCorpus) + .RunGeneratorsAndUpdateCompilation(GeneratorHarness.BuildCompilation(GeneratorHarness.AllCorpus, Copies), out var compilation, out _); + foreach (var (name, generator) in DiscoveryGenerators.Strategies) + { + var found = CreateDriver(generator).RunGenerators(compilation).GetRunResult().Results[0].GeneratedSources[0].SourceText.ToString(); + yield return $"{name}: {found}"; + } + } + + /// Creates a cold driver for one discovery generator. + /// The generator. + /// The driver. + private static CSharpGeneratorDriver CreateDriver(IIncrementalGenerator generator) => + CSharpGeneratorDriver.Create([generator.AsSourceGenerator()], parseOptions: new(LanguageVersion.CSharp13)); + + /// Finds a tree by file name. + /// The compilation. + /// The file name. + /// The tree. + private static SyntaxTree FindTree(Compilation compilation, string fileName) + { + foreach (var tree in compilation.SyntaxTrees) + { + if (Path.GetFileName(tree.FilePath) == fileName) + { + return tree; + } + } + + throw new InvalidOperationException($"The corpus has no {fileName}."); + } + + /// Runs a driver and returns the length of what it wrote, so the work is kept. + /// The driver. + /// The compilation. + /// The generated length. + private static long Run(GeneratorDriver driver, Compilation compilation) => + driver.RunGenerators(compilation).GetRunResult().Results[0].GeneratedSources[0].SourceText.Length; +} diff --git a/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Support/GenerationScenarios.cs b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Support/GenerationScenarios.cs new file mode 100644 index 00000000..e6220fa3 --- /dev/null +++ b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Support/GenerationScenarios.cs @@ -0,0 +1,103 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using ReactiveUI.SourceGenerators.Benchmarks.Shared; + +namespace ReactiveUI.SourceGenerators.Benchmarks.Support; + +/// The generation scenarios the EventPipe allocation harness measures. +internal static class GenerationScenarios +{ + /// How many times each mock file is repeated, each copy in its own namespace. + private const int Copies = 20; + + /// The operations a cold-generation session runs; enough for hundreds of megabytes of allocation. + private const int ColdOperations = 60; + + /// The operations an incremental session runs. + private const int IncrementalOperations = 400; + + /// The text an unrelated edit changes: a member of a noise class no generator reads. + private const string UnrelatedEditTarget = "public override string ToString() => Customer ?? string.Empty;"; + + /// The text a related edit changes: a member of a class with [Reactive] fields that is not itself generated from. + private const string RelatedEditTarget = "public string FullName => FirstName + \" \" + LastName;"; + + /// The text a model edit changes: a [Reactive] field's name, which changes that one type's model. + private const string ModelEditTarget = "private int _age;"; + + /// Creates every scenario: a cold generation per corpus, and warm reruns after an edit. + /// The scenarios. + internal static List Create() + { + var scenarios = new List(); + foreach (var corpus in GeneratorCatalog.Corpora) + { + Compilation compilation = null!; + scenarios.Add(new( + $"Cold-{corpus}", + ColdOperations, + () => compilation = GeneratorHarness.BuildCompilation(corpus, Copies), + () => CountGenerated(GeneratorHarness.CreateDriver(corpus).RunGenerators(compilation)))); + } + + scenarios.Add(CreateIncremental("Incremental-UnrelatedEdit", "Noise0.cs", UnrelatedEditTarget, "public override string ToString() => Customer ?? \"none\";")); + scenarios.Add(CreateIncremental("Incremental-ReactiveClassEdit", "Reactive0.cs", RelatedEditTarget, "public string FullName => LastName + \", \" + FirstName;")); + scenarios.Add(CreateIncremental("Incremental-ReactiveModelEdit", "Reactive0.cs", ModelEditTarget, "private int _ageInYears;")); + return scenarios; + } + + /// Creates a scenario that reruns a warm driver over a compilation with one tree edited. + /// The scenario name. + /// The file name of the tree to edit. + /// The text to replace in that tree. + /// The replacement. + /// The scenario. + /// + /// The warm driver is never replaced, so every operation reruns from the same cached state against the same edit, + /// which is what one keystroke costs in the IDE. + /// + private static AllocationScenario CreateIncremental(string name, string treeName, string find, string replace) + { + GeneratorDriver warm = null!; + Compilation edited = null!; + return new( + name, + IncrementalOperations, + () => + { + var compilation = GeneratorHarness.BuildCompilation(GeneratorHarness.AllCorpus, Copies); + warm = GeneratorHarness.CreateDriver(GeneratorHarness.AllCorpus).RunGenerators(compilation); + var tree = compilation.SyntaxTrees.Single(t => Path.GetFileName(t.FilePath) == treeName); + var text = tree.GetText().ToString(); + if (!text.Contains(find, StringComparison.Ordinal)) + { + throw new InvalidOperationException($"{treeName} no longer contains the text the {name} scenario edits."); + } + + var newTree = tree.WithChangedText(Microsoft.CodeAnalysis.Text.SourceText.From(text.Replace(find, replace, StringComparison.Ordinal))); + edited = compilation.ReplaceSyntaxTree(tree, newTree); + }, + () => CountGenerated(warm.RunGenerators(edited))); + } + + /// Counts the characters a driver's last run generated. + /// The driver. + /// The number of generated characters. + private static long CountGenerated(GeneratorDriver driver) + { + var characters = 0L; + foreach (var result in driver.GetRunResult().Results) + { + foreach (var generated in result.GeneratedSources) + { + characters += generated.SourceText.Length; + } + } + + return characters; + } +} diff --git a/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Support/GeneratorCatalog.cs b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Support/GeneratorCatalog.cs new file mode 100644 index 00000000..8c11ba70 --- /dev/null +++ b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Support/GeneratorCatalog.cs @@ -0,0 +1,61 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using Microsoft.CodeAnalysis; +using ReactiveUI.SourceGenerators.WinForms; + +namespace ReactiveUI.SourceGenerators.Benchmarks.Support; + +/// Names the generators the package ships and the mock corpus each one reads. +internal static class GeneratorCatalog +{ + /// Gets the corpus names, one per generator, each matching a file in the mocks folder. + internal static IEnumerable Corpora => + [ + "Reactive", + "ReactiveCommand", + "ReactiveObject", + "BindableDerivedList", + "ReactiveCollection", + "IViewFor", + "ViewModelControlHost", + "RoutedControlHost", + GeneratorHarness.AllCorpus, + ]; + + /// Creates the generators a corpus exercises: its own generator, or every generator for the whole corpus. + /// The corpus name. + /// The generators. + /// + /// always runs, because it injects the modifier enums the other attributes take. + /// No other corpus marks a member [Reactive], so it adds only its fixed cost. + /// + internal static ISourceGenerator[] Create(string corpus) => + corpus switch + { + "Reactive" => [new ReactiveGenerator().AsSourceGenerator()], + "ReactiveCommand" => [new ReactiveGenerator().AsSourceGenerator(), new ReactiveCommandGenerator().AsSourceGenerator()], + "ReactiveObject" => [new ReactiveGenerator().AsSourceGenerator(), new ReactiveObjectGenerator().AsSourceGenerator()], + "BindableDerivedList" => [new ReactiveGenerator().AsSourceGenerator(), new BindableDerivedListGenerator().AsSourceGenerator()], + "ReactiveCollection" => [new ReactiveGenerator().AsSourceGenerator(), new ReactiveCollectionGenerator().AsSourceGenerator()], + "IViewFor" => [new ReactiveGenerator().AsSourceGenerator(), new IViewForGenerator().AsSourceGenerator()], + "ViewModelControlHost" => [new ReactiveGenerator().AsSourceGenerator(), new ViewModelControlHostGenerator().AsSourceGenerator()], + "RoutedControlHost" => [new ReactiveGenerator().AsSourceGenerator(), new RoutedControlHostGenerator().AsSourceGenerator()], + _ => Create(), + }; + + /// Creates every generator the package ships. + /// The generators. + internal static ISourceGenerator[] Create() => + [ + new ReactiveGenerator().AsSourceGenerator(), + new ReactiveCommandGenerator().AsSourceGenerator(), + new ReactiveObjectGenerator().AsSourceGenerator(), + new BindableDerivedListGenerator().AsSourceGenerator(), + new ReactiveCollectionGenerator().AsSourceGenerator(), + new IViewForGenerator().AsSourceGenerator(), + new ViewModelControlHostGenerator().AsSourceGenerator(), + new RoutedControlHostGenerator().AsSourceGenerator(), + ]; +} diff --git a/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Support/GeneratorHarness.cs b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Support/GeneratorHarness.cs new file mode 100644 index 00000000..f2b7317e --- /dev/null +++ b/src/benchmarks/ReactiveUI.SourceGenerators.Benchmarks/Support/GeneratorHarness.cs @@ -0,0 +1,149 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System.Reflection; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; + +namespace ReactiveUI.SourceGenerators.Benchmarks.Support; + +/// Builds the compilation and the generator driver the generation benchmarks run. +internal static class GeneratorHarness +{ + /// The corpus name that selects every mock file. + internal const string AllCorpus = "All"; + + /// The folder beside the benchmark assembly that holds the mock consumer source. + private const string MocksFolder = "Mocks"; + + /// The token in a mock file that each copy replaces with its own index. + private const string IndexToken = "__N__"; + + /// The parse options every benchmark compilation uses. + private static readonly CSharpParseOptions ParseOptions = new(LanguageVersion.CSharp13); + + /// The metadata references for the mock consumer, resolved once per process. + private static readonly Lazy> References = new(CreateReferences); + + /// Builds a compilation over the mock consumer source copied beside the benchmark assembly. + /// The mock file name without extension, or for every mock file. + /// How many times each mock file is repeated, each copy in its own namespace. + /// The compilation. + internal static CSharpCompilation BuildCompilation(string corpus, int copies) + { + var paths = Directory.GetFiles(Path.Combine(AppContext.BaseDirectory, MocksFolder), "*.cs"); + Array.Sort(paths, StringComparer.Ordinal); + + var syntaxTrees = new List(); + foreach (var path in paths) + { + var name = Path.GetFileNameWithoutExtension(path); + + // Stubs and Noise are in every corpus: the platform types the mocks derive from, and code no generator acts on. + if (corpus != AllCorpus && !string.Equals(name, corpus, StringComparison.Ordinal) && name is not ("Stubs" or "Noise")) + { + continue; + } + + var template = File.ReadAllText(path); + if (!template.Contains(IndexToken, StringComparison.Ordinal)) + { + syntaxTrees.Add(CSharpSyntaxTree.ParseText(template, ParseOptions, path)); + continue; + } + + for (var i = 0; i < copies; i++) + { + var text = template.Replace(IndexToken, i.ToString(System.Globalization.CultureInfo.InvariantCulture), StringComparison.Ordinal); + syntaxTrees.Add(CSharpSyntaxTree.ParseText(text, ParseOptions, $"{name}{i}.cs")); + } + } + + return CSharpCompilation.Create( + "Mocks", + syntaxTrees, + References.Value, + new(OutputKind.DynamicallyLinkedLibrary, nullableContextOptions: NullableContextOptions.Enable)); + } + + /// Creates a cold generator driver for a corpus, carrying no caches from a previous run. + /// The corpus whose generators the driver runs. + /// The generator driver. + internal static GeneratorDriver CreateDriver(string corpus) => + CSharpGeneratorDriver.Create( + GeneratorCatalog.Create(corpus), + parseOptions: ParseOptions); + + /// Generates over a corpus and counts the errors in the resulting compilation, printing each one. + /// The corpus name. + /// The number of errors. + internal static int CountErrors(string corpus) + { + _ = CreateDriver(corpus).RunGeneratorsAndUpdateCompilation(BuildCompilation(corpus, 1), out var output, out _); + var errors = 0; + foreach (var diagnostic in output.GetDiagnostics()) + { + if (diagnostic.Severity == DiagnosticSeverity.Error) + { + errors++; + Console.WriteLine($" {diagnostic}"); + } + } + + return errors; + } + + /// Creates the metadata references for the mock consumer: the runtime plus ReactiveUI and its dependencies. + /// The references. + private static List CreateReferences() + { + var visited = new HashSet(StringComparer.OrdinalIgnoreCase); + var references = new List(); + Assembly[] seeds = + [ + typeof(object).Assembly, + typeof(Enumerable).Assembly, + typeof(System.ComponentModel.INotifyPropertyChanged).Assembly, + typeof(ReactiveUI.Reactive.ReactiveObject).Assembly, + typeof(System.Reactive.Unit).Assembly, + typeof(DynamicData.SourceList<>).Assembly, + typeof(Splat.Locator).Assembly, + typeof(System.Text.Json.JsonSerializer).Assembly, + typeof(System.Runtime.Serialization.DataContractAttribute).Assembly, + typeof(System.ComponentModel.DescriptionAttribute).Assembly, + ]; + + foreach (var seed in seeds) + { + AddTransitive(seed, visited, references); + } + + return references; + } + + /// Adds an assembly and its loadable references to the reference list. + /// The assembly. + /// The assembly locations already added. + /// The references to add to. + private static void AddTransitive(Assembly assembly, HashSet visited, List references) + { + if (assembly.IsDynamic || string.IsNullOrEmpty(assembly.Location) || !visited.Add(assembly.Location)) + { + return; + } + + references.Add(MetadataReference.CreateFromFile(assembly.Location)); + foreach (var name in assembly.GetReferencedAssemblies()) + { + try + { + AddTransitive(Assembly.Load(name), visited, references); + } + catch (FileNotFoundException) + { + // A facade the runtime does not ship is not needed by the mocks. + } + } + } +} diff --git a/src/benchmarks/ReactiveUI.SourceGenerators.Runtime.Benchmarks/BenchmarkPlainObject.cs b/src/benchmarks/ReactiveUI.SourceGenerators.Runtime.Benchmarks/BenchmarkPlainObject.cs new file mode 100644 index 00000000..09e9cc89 --- /dev/null +++ b/src/benchmarks/ReactiveUI.SourceGenerators.Runtime.Benchmarks/BenchmarkPlainObject.cs @@ -0,0 +1,16 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using ReactiveUI.SourceGenerators; + +namespace ReactiveUI.SourceGenerators.Runtime.Benchmarks; + +/// An object that implements IReactiveObject through the generator rather than a base class. +[IReactiveObject] +public partial class BenchmarkPlainObject +{ + /// Backs the generated Value property. + [Reactive] + private int _value; +} diff --git a/src/benchmarks/ReactiveUI.SourceGenerators.Runtime.Benchmarks/BenchmarkViewModel.cs b/src/benchmarks/ReactiveUI.SourceGenerators.Runtime.Benchmarks/BenchmarkViewModel.cs new file mode 100644 index 00000000..dbc09844 --- /dev/null +++ b/src/benchmarks/ReactiveUI.SourceGenerators.Runtime.Benchmarks/BenchmarkViewModel.cs @@ -0,0 +1,31 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated 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.SourceGenerators; + +namespace ReactiveUI.SourceGenerators.Runtime.Benchmarks; + +/// A view model whose members the generators write, measured by . +public partial class BenchmarkViewModel : ReactiveObject +{ + /// Backs the generated Items property. + [ReactiveCollection] + private ObservableCollection? _items; + + /// Backs the generated Name property, which also notifies . + [Reactive(nameof(Greeting))] + private string _name = string.Empty; + + /// Backs the generated Count property. + [Reactive] + private int _count; + + /// Gets a value computed from Name. + public string Greeting => Name; + + /// Increments Count; the generated command runs it. + [ReactiveCommand] + private void Increment() => Count++; +} diff --git a/src/benchmarks/ReactiveUI.SourceGenerators.Runtime.Benchmarks/GeneratedCodeBenchmarks.cs b/src/benchmarks/ReactiveUI.SourceGenerators.Runtime.Benchmarks/GeneratedCodeBenchmarks.cs new file mode 100644 index 00000000..5e861daf --- /dev/null +++ b/src/benchmarks/ReactiveUI.SourceGenerators.Runtime.Benchmarks/GeneratedCodeBenchmarks.cs @@ -0,0 +1,95 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated 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 System.ComponentModel; +using BenchmarkDotNet.Attributes; + +namespace ReactiveUI.SourceGenerators.Runtime.Benchmarks; + +/// Measures the members the generators write, as a consumer's app runs them. +/// +/// Each benchmark has one PropertyChanged subscriber, as a bound view would, so the notifications the generated +/// code raises are delivered. Allocations per operation are the figure to watch: the generated code should add none of +/// its own beyond what ReactiveUI's notification needs. +/// +public class GeneratedCodeBenchmarks +{ + /// The view model under measurement. + private readonly BenchmarkViewModel _viewModel = new(); + + /// The plain object under measurement. + private readonly BenchmarkPlainObject _plainObject = new(); + + /// The first of two collections the collection property alternates between. + private readonly ObservableCollection _first = []; + + /// The second of two collections the collection property alternates between. + private readonly ObservableCollection _second = []; + + /// The number of notifications delivered, so the subscriber cannot be optimized away. + private int _notifications; + + /// Which value the next set writes. + private bool _toggle; + + /// Subscribes to both objects' notifications and gives the collection property its first value. + [GlobalSetup] + public void Setup() + { + _viewModel.PropertyChanged += OnPropertyChanged; + _plainObject.PropertyChanged += OnPropertyChanged; + _viewModel.Items = _first; + } + + /// Replaces the collection a [ReactiveCollection] property holds. + /// The number of notifications delivered so far. + [Benchmark] + public int ReplaceCollection() + { + _toggle = !_toggle; + _viewModel.Items = _toggle ? _second : _first; + return _notifications; + } + + /// Adds to and clears the collection a [ReactiveCollection] property holds. + /// The number of notifications delivered so far. + [Benchmark] + public int ChangeCollection() + { + var items = _viewModel.Items!; + items.Add(1); + items.Clear(); + return _notifications; + } + + /// Sets a [Reactive] property that also notifies another property. + /// The number of notifications delivered so far. + [Benchmark] + public int SetReactivePropertyWithAlsoNotify() + { + _toggle = !_toggle; + _viewModel.Name = _toggle ? "first" : "second"; + return _notifications; + } + + /// Sets a [Reactive] property on a type that implements IReactiveObject through [IReactiveObject]. + /// The number of notifications delivered so far. + [Benchmark] + public int SetGeneratedReactiveObjectProperty() + { + _plainObject.Value++; + return _notifications; + } + + /// Reads a generated command, which is created on first use. + /// The command's hash code, so the read cannot be optimized away. + [Benchmark] + public int ReadCommand() => _viewModel.IncrementCommand.GetHashCode(); + + /// Counts a delivered notification. + /// The object that raised it. + /// The notification. + private void OnPropertyChanged(object? sender, PropertyChangedEventArgs e) => _notifications++; +} diff --git a/src/benchmarks/ReactiveUI.SourceGenerators.Runtime.Benchmarks/Program.cs b/src/benchmarks/ReactiveUI.SourceGenerators.Runtime.Benchmarks/Program.cs new file mode 100644 index 00000000..61a8e22e --- /dev/null +++ b/src/benchmarks/ReactiveUI.SourceGenerators.Runtime.Benchmarks/Program.cs @@ -0,0 +1,53 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System.Diagnostics.Tracing; +using BenchmarkDotNet.Configs; +using BenchmarkDotNet.Diagnosers; +using BenchmarkDotNet.Running; +using Microsoft.Diagnostics.NETCore.Client; +using Microsoft.Diagnostics.Tracing.Parsers; +using ReactiveUI.SourceGenerators.Benchmarks.Shared; + +namespace ReactiveUI.SourceGenerators.Runtime.Benchmarks; + +/// Entry point that hands the command line to the BenchmarkDotNet switcher. +internal static class Program +{ + /// The environment variable that turns the EventPipe profiler off when set to false. + private const string ProfilersVariable = "BENCHMARK_PROFILERS"; + + /// Runs the benchmarks the command line selects, or --eventpipe dir to trace allocations. + /// The command-line arguments. + internal static void Main(string[] args) + { + if (args is ["--eventpipe", var outputDirectory]) + { + // Allocation figures: GCAllocationTick events from an EventPipe session over a fixed number of operations. + _ = EventPipeAllocations.Measure(RuntimeScenarios.Create(), outputDirectory); + return; + } + + _ = BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, CreateConfig()); + } + + /// Creates the run configuration. + /// An EventPipe trace per benchmark unless profiling is turned off; allocation figures come from its GC events. + private static ManualConfig CreateConfig() + { + var config = ManualConfig.Create(DefaultConfig.Instance); + if (string.Equals(Environment.GetEnvironmentVariable(ProfilersVariable), "false", StringComparison.OrdinalIgnoreCase)) + { + return config; + } + + EventPipeProvider[] providers = + [ + new("Microsoft-DotNETCore-SampleProfiler", EventLevel.Informational), + new(ClrTraceEventParser.ProviderName, EventLevel.Verbose, (long)(ClrTraceEventParser.Keywords.Default | ClrTraceEventParser.Keywords.GCHandle)), + ]; + + return config.AddDiagnoser(new EventPipeProfiler(EventPipeProfile.GcVerbose, providers)); + } +} diff --git a/src/benchmarks/ReactiveUI.SourceGenerators.Runtime.Benchmarks/ReactiveUI.SourceGenerators.Runtime.Benchmarks.csproj b/src/benchmarks/ReactiveUI.SourceGenerators.Runtime.Benchmarks/ReactiveUI.SourceGenerators.Runtime.Benchmarks.csproj new file mode 100644 index 00000000..7e44eeea --- /dev/null +++ b/src/benchmarks/ReactiveUI.SourceGenerators.Runtime.Benchmarks/ReactiveUI.SourceGenerators.Runtime.Benchmarks.csproj @@ -0,0 +1,30 @@ + + + + net10.0 + Exe + false + enable + enable + + $(NoWarn);CA1515;CA1822;CA1001 + + + + + + + + + + + + + + + + + + + + diff --git a/src/benchmarks/ReactiveUI.SourceGenerators.Runtime.Benchmarks/RuntimeScenarios.cs b/src/benchmarks/ReactiveUI.SourceGenerators.Runtime.Benchmarks/RuntimeScenarios.cs new file mode 100644 index 00000000..30c577e0 --- /dev/null +++ b/src/benchmarks/ReactiveUI.SourceGenerators.Runtime.Benchmarks/RuntimeScenarios.cs @@ -0,0 +1,38 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using ReactiveUI.SourceGenerators.Benchmarks.Shared; + +namespace ReactiveUI.SourceGenerators.Runtime.Benchmarks; + +/// The generated-code scenarios the EventPipe allocation harness measures. +internal static class RuntimeScenarios +{ + /// The operations each session runs; enough that one allocation tick is a small fraction of the total. + private const int Operations = 2_000_000; + + /// + /// The operations the collection-replacing session runs. Generated collection properties used to leak a handler per + /// replacement, so each replacement cost more than the last; this count lets that code finish. + /// + private const int ReplaceCollectionOperations = 20_000; + + /// The operations the collection-changing session runs, after the replacements above have left their handlers. + private const int ChangeCollectionOperations = 2_000; + + /// Creates one scenario per benchmark. + /// The scenarios. + internal static List Create() + { + var benchmarks = new GeneratedCodeBenchmarks(); + return + [ + new("ReplaceCollection", ReplaceCollectionOperations, benchmarks.Setup, () => benchmarks.ReplaceCollection()), + new("ChangeCollection", ChangeCollectionOperations, static () => { }, () => benchmarks.ChangeCollection()), + new("SetReactivePropertyWithAlsoNotify", Operations, static () => { }, () => benchmarks.SetReactivePropertyWithAlsoNotify()), + new("SetGeneratedReactiveObjectProperty", Operations, static () => { }, () => benchmarks.SetGeneratedReactiveObjectProperty()), + new("ReadCommand", Operations, static () => { }, () => benchmarks.ReadCommand()), + ]; + } +} diff --git a/src/benchmarks/Shared/AllocationScenario.cs b/src/benchmarks/Shared/AllocationScenario.cs new file mode 100644 index 00000000..751e5a13 --- /dev/null +++ b/src/benchmarks/Shared/AllocationScenario.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +namespace ReactiveUI.SourceGenerators.Benchmarks.Shared; + +/// One measured operation and how often to run it. +/// The scenario name, also the trace's file name. +/// How many operations the traced session runs. +/// Prepares the scenario before its warmup. +/// One operation; its result is kept so the work cannot be optimized away. +public sealed record AllocationScenario(string Name, int Operations, Action Setup, Func Operation); diff --git a/src/benchmarks/Shared/EventPipeAllocations.cs b/src/benchmarks/Shared/EventPipeAllocations.cs new file mode 100644 index 00000000..4f9c2438 --- /dev/null +++ b/src/benchmarks/Shared/EventPipeAllocations.cs @@ -0,0 +1,130 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System.Diagnostics.Tracing; +using System.Globalization; +using System.Text; +using Microsoft.Diagnostics.NETCore.Client; +using Microsoft.Diagnostics.Tracing; +using Microsoft.Diagnostics.Tracing.Parsers; + +namespace ReactiveUI.SourceGenerators.Benchmarks.Shared; + +/// Measures allocations per operation from an EventPipe trace of the running process. +/// +/// +/// Each scenario runs a fixed number of operations inside an EventPipe session on this process with the runtime +/// provider's GC keyword at verbose level, which raises a GCAllocationTick event roughly every 100 KB allocated, +/// carrying the exact amount, the allocated type and the call stack. The sum of those amounts divided by the operation +/// count is the allocation per operation; its sampling error is one tick (about 100 KB) over the whole session, so +/// sessions run enough operations to allocate hundreds of megabytes. +/// +/// +/// The trace of each scenario is kept, so the allocated types and the frames that allocated them can be broken down +/// afterwards in PerfView. The Jit and Loader keywords are on so the frames resolve to methods. +/// +/// +public static class EventPipeAllocations +{ + /// The runtime keywords the session enables: GC for the allocation ticks, and what resolves their stacks. + private const ClrTraceEventParser.Keywords SessionKeywords = + ClrTraceEventParser.Keywords.GC | ClrTraceEventParser.Keywords.Jit | ClrTraceEventParser.Keywords.Loader + | ClrTraceEventParser.Keywords.Stack; + + /// The number of untraced runs before a session, so JIT and first-use caches are out of the figure. + private const int WarmupOperations = 5; + + /// Traces each scenario and writes a markdown table of the allocations per operation. + /// The scenarios to measure. + /// The directory the traces and the table are written to. + /// The table, also written to allocations.md in . + public static string Measure(IReadOnlyList scenarios, string outputDirectory) + { + ArgumentNullException.ThrowIfNull(scenarios); + _ = Directory.CreateDirectory(outputDirectory); + + var table = new StringBuilder() + .AppendLine("| Scenario | Operations | Sampled bytes per operation | Allocation ticks |") + .AppendLine("| --- | ---: | ---: | ---: |"); + + foreach (var scenario in scenarios) + { + var result = Measure(scenario, Path.Combine(outputDirectory, $"{scenario.Name}.nettrace")); + _ = table.Append("| ").Append(scenario.Name) + .Append(" | ").Append(scenario.Operations.ToString("N0", CultureInfo.InvariantCulture)) + .Append(" | ").Append((result.Bytes / scenario.Operations).ToString("N0", CultureInfo.InvariantCulture)) + .Append(" | ").Append(result.Ticks.ToString("N0", CultureInfo.InvariantCulture)) + .AppendLine(" |"); + Console.WriteLine($"{scenario.Name}: {result.Bytes / scenario.Operations:N0} bytes/op ({result.Ticks:N0} ticks)"); + } + + var text = table.ToString(); + File.WriteAllText(Path.Combine(outputDirectory, "allocations.md"), text); + return text; + } + + /// Traces one scenario. + /// The scenario. + /// The file the trace is written to. + /// The sampled bytes and the number of allocation ticks. + private static (long Bytes, long Ticks) Measure(AllocationScenario scenario, string tracePath) + { + scenario.Setup(); + var sink = 0L; + for (var i = 0; i < WarmupOperations; i++) + { + sink += scenario.Operation(); + } + + GC.Collect(); + GC.WaitForPendingFinalizers(); + GC.Collect(); + + var client = new DiagnosticsClient(Environment.ProcessId); + EventPipeProvider[] providers = [new(ClrTraceEventParser.ProviderName, EventLevel.Verbose, (long)SessionKeywords)]; + using (var session = client.StartEventPipeSession(providers, requestRundown: true, circularBufferMB: 1024)) + { + var copy = Task.Run(() => + { + using var file = File.Create(tracePath); + session.EventStream.CopyTo(file); + }); + + for (var i = 0; i < scenario.Operations; i++) + { + sink += scenario.Operation(); + } + + session.Stop(); + copy.Wait(); + } + + GC.KeepAlive(sink); + return SumAllocationTicks(tracePath, Environment.ProcessId); + } + + /// Sums the allocation ticks a process raised in a trace. + /// The trace. + /// The process whose ticks count. + /// The sampled bytes and the number of ticks. + private static (long Bytes, long Ticks) SumAllocationTicks(string tracePath, int processId) + { + long bytes = 0; + long ticks = 0; + using var source = new EventPipeEventSource(tracePath); + source.Clr.GCAllocationTick += allocation => + { + if (allocation.ProcessID != processId) + { + return; + } + + bytes += allocation.AllocationAmount64; + ticks++; + }; + + _ = source.Process(); + return (bytes, ticks); + } +}