-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for Generation fails with partial classes (#26)
* Fix for #24 Change from class analyser to method analyser * Update code issues
- Loading branch information
1 parent
6d61331
commit bc0db32
Showing
9 changed files
with
241 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/ReactiveUI.SourceGenerators.Execute/TestViewModel{partTwo}.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (c) 2024 .NET Foundation and Contributors. All rights reserved. | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for full license information. | ||
|
||
using ReactiveUI.SourceGenerators; | ||
|
||
namespace SGReactiveUI.SourceGenerators.Test | ||
{ | ||
/// <summary> | ||
/// TestViewModel. | ||
/// </summary> | ||
/// <seealso cref="ReactiveUI.ReactiveObject" /> | ||
public partial class TestViewModel | ||
{ | ||
/// <summary> | ||
/// Test2s this instance. | ||
/// </summary> | ||
/// <returns>Rectangle.</returns> | ||
[ReactiveCommand] | ||
private Point Test2() => default; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
src/ReactiveUI.SourceGenerators/ReactiveCommand/Models/CommandExtensionInfo.cs
This file was deleted.
Oops, something went wrong.
34 changes: 24 additions & 10 deletions
34
src/ReactiveUI.SourceGenerators/ReactiveCommand/Models/CommandInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,32 @@ | ||
// Copyright (c) 2024 .NET Foundation and Contributors. All rights reserved. | ||
// Copyright (c) 2024 .NET Foundation and Contributors. All rights reserved. | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for full license information. | ||
|
||
using Microsoft.CodeAnalysis.CSharp.Syntax; | ||
using Microsoft.CodeAnalysis; | ||
using ReactiveUI.SourceGenerators.Helpers; | ||
using ReactiveUI.SourceGenerators.Models; | ||
|
||
namespace ReactiveUI.SourceGenerators.Input.Models; | ||
|
||
/// <summary> | ||
/// A model with gathered info on a given command method. | ||
/// </summary> | ||
internal sealed record CommandInfo( | ||
string ClassNamespace, | ||
string ClassName, | ||
ClassDeclarationSyntax DeclarationSyntax, | ||
EquatableArray<CommandExtensionInfo> CommandExtensionInfos); | ||
internal record CommandInfo( | ||
string MethodName, | ||
ITypeSymbol MethodReturnType, | ||
ITypeSymbol? ArgumentType, | ||
bool IsTask, | ||
bool IsReturnTypeVoid, | ||
bool IsObservable, | ||
string? CanExecuteObservableName, | ||
CanExecuteTypeInfo? CanExecuteTypeInfo, | ||
EquatableArray<AttributeInfo> ForwardedPropertyAttributes) | ||
{ | ||
private const string UnitTypeName = "global::System.Reactive.Unit"; | ||
|
||
public string GetOutputTypeText() => IsReturnTypeVoid | ||
? UnitTypeName | ||
: MethodReturnType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); | ||
|
||
public string GetInputTypeText() => ArgumentType == null | ||
? UnitTypeName | ||
: ArgumentType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); | ||
} |
Oops, something went wrong.