Use CSharpier

This commit is contained in:
Tyrrrz
2023-08-22 21:20:04 +03:00
parent a4726fcefd
commit 21b601da66
99 changed files with 975 additions and 1163 deletions

View File

@@ -13,14 +13,14 @@ public class ParameterMustBeInsideCommandAnalyzer : AnalyzerBase
public ParameterMustBeInsideCommandAnalyzer()
: base(
"Parameters must be defined inside commands",
$"This parameter must be defined inside a class that implements `{SymbolNames.CliFxCommandInterface}`.")
{
}
$"This parameter must be defined inside a class that implements `{SymbolNames.CliFxCommandInterface}`."
) { }
private void Analyze(
SyntaxNodeAnalysisContext context,
PropertyDeclarationSyntax propertyDeclaration,
IPropertySymbol property)
IPropertySymbol property
)
{
if (property.ContainingType is null)
return;
@@ -31,10 +31,9 @@ public class ParameterMustBeInsideCommandAnalyzer : AnalyzerBase
if (!CommandParameterSymbol.IsParameterProperty(property))
return;
var isInsideCommand = property
.ContainingType
.AllInterfaces
.Any(i => i.DisplayNameMatches(SymbolNames.CliFxCommandInterface));
var isInsideCommand = property.ContainingType.AllInterfaces.Any(
i => i.DisplayNameMatches(SymbolNames.CliFxCommandInterface)
);
if (!isInsideCommand)
{
@@ -49,4 +48,4 @@ public class ParameterMustBeInsideCommandAnalyzer : AnalyzerBase
base.Initialize(context);
context.HandlePropertyDeclaration(Analyze);
}
}
}