mirror of
https://github.com/Tyrrrz/CliFx.git
synced 2025-10-25 15:19:17 +00:00
Refactor with C# 12 features
This commit is contained in:
@@ -5,36 +5,26 @@ using Microsoft.CodeAnalysis;
|
||||
|
||||
namespace CliFx.Analyzers.ObjectModel;
|
||||
|
||||
internal partial class CommandOptionSymbol : ICommandMemberSymbol
|
||||
internal partial class CommandOptionSymbol(
|
||||
IPropertySymbol property,
|
||||
string? name,
|
||||
char? shortName,
|
||||
bool? isRequired,
|
||||
ITypeSymbol? converterType,
|
||||
IReadOnlyList<ITypeSymbol> validatorTypes
|
||||
) : ICommandMemberSymbol
|
||||
{
|
||||
public IPropertySymbol Property { get; }
|
||||
public IPropertySymbol Property { get; } = property;
|
||||
|
||||
public string? Name { get; }
|
||||
public string? Name { get; } = name;
|
||||
|
||||
public char? ShortName { get; }
|
||||
public char? ShortName { get; } = shortName;
|
||||
|
||||
public bool? IsRequired { get; }
|
||||
public bool? IsRequired { get; } = isRequired;
|
||||
|
||||
public ITypeSymbol? ConverterType { get; }
|
||||
public ITypeSymbol? ConverterType { get; } = converterType;
|
||||
|
||||
public IReadOnlyList<ITypeSymbol> ValidatorTypes { get; }
|
||||
|
||||
public CommandOptionSymbol(
|
||||
IPropertySymbol property,
|
||||
string? name,
|
||||
char? shortName,
|
||||
bool? isRequired,
|
||||
ITypeSymbol? converterType,
|
||||
IReadOnlyList<ITypeSymbol> validatorTypes
|
||||
)
|
||||
{
|
||||
Property = property;
|
||||
Name = name;
|
||||
ShortName = shortName;
|
||||
IsRequired = isRequired;
|
||||
ConverterType = converterType;
|
||||
ValidatorTypes = validatorTypes;
|
||||
}
|
||||
public IReadOnlyList<ITypeSymbol> ValidatorTypes { get; } = validatorTypes;
|
||||
}
|
||||
|
||||
internal partial class CommandOptionSymbol
|
||||
|
||||
@@ -5,36 +5,26 @@ using Microsoft.CodeAnalysis;
|
||||
|
||||
namespace CliFx.Analyzers.ObjectModel;
|
||||
|
||||
internal partial class CommandParameterSymbol : ICommandMemberSymbol
|
||||
internal partial class CommandParameterSymbol(
|
||||
IPropertySymbol property,
|
||||
int order,
|
||||
string? name,
|
||||
bool? isRequired,
|
||||
ITypeSymbol? converterType,
|
||||
IReadOnlyList<ITypeSymbol> validatorTypes
|
||||
) : ICommandMemberSymbol
|
||||
{
|
||||
public IPropertySymbol Property { get; }
|
||||
public IPropertySymbol Property { get; } = property;
|
||||
|
||||
public int Order { get; }
|
||||
public int Order { get; } = order;
|
||||
|
||||
public string? Name { get; }
|
||||
public string? Name { get; } = name;
|
||||
|
||||
public bool? IsRequired { get; }
|
||||
public bool? IsRequired { get; } = isRequired;
|
||||
|
||||
public ITypeSymbol? ConverterType { get; }
|
||||
public ITypeSymbol? ConverterType { get; } = converterType;
|
||||
|
||||
public IReadOnlyList<ITypeSymbol> ValidatorTypes { get; }
|
||||
|
||||
public CommandParameterSymbol(
|
||||
IPropertySymbol property,
|
||||
int order,
|
||||
string? name,
|
||||
bool? isRequired,
|
||||
ITypeSymbol? converterType,
|
||||
IReadOnlyList<ITypeSymbol> validatorTypes
|
||||
)
|
||||
{
|
||||
Property = property;
|
||||
Order = order;
|
||||
Name = name;
|
||||
IsRequired = isRequired;
|
||||
ConverterType = converterType;
|
||||
ValidatorTypes = validatorTypes;
|
||||
}
|
||||
public IReadOnlyList<ITypeSymbol> ValidatorTypes { get; } = validatorTypes;
|
||||
}
|
||||
|
||||
internal partial class CommandParameterSymbol
|
||||
|
||||
Reference in New Issue
Block a user