From 6056a2e9c813168d87ee782744b6319fba827caf Mon Sep 17 00:00:00 2001 From: pshao25 <97225342+pshao25@users.noreply.github.com> Date: Thu, 27 Jul 2023 12:55:04 +0800 Subject: [PATCH] update --- .../Azure.ClientSdk.Analyzers/ClientMethodsAnalyzer.cs | 2 +- .../Azure.ClientSdk.Analyzers/Descriptors.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/ClientMethodsAnalyzer.cs b/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/ClientMethodsAnalyzer.cs index b84c873b587..8caf97d2788 100644 --- a/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/ClientMethodsAnalyzer.cs +++ b/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/ClientMethodsAnalyzer.cs @@ -121,7 +121,7 @@ private static void CheckProtocolMethodParameters(ISymbolAnalysisContext context INamedTypeSymbol type = (INamedTypeSymbol)context.Symbol; IEnumerable methodList = type.GetMembers(method.Name).OfType().Where(member => !SymbolEqualityComparer.Default.Equals(member, method)); ImmutableArray parametersWithoutLast = method.Parameters.RemoveAt(method.Parameters.Length - 1); - IMethodSymbol convenienceMethod = FindMethod(methodList, method.TypeParameters, parametersWithoutLast, symbol => IsCancellationToken(symbol), ParameterEquivalenceComparerOptionalIgnore.Default); + IMethodSymbol convenienceMethod = FindMethod(methodList, method.TypeParameters, parametersWithoutLast, symbol => IsCancellationToken(symbol)); if (convenienceMethod != null) { context.ReportDiagnostic(Diagnostic.Create(Descriptors.AZC0019, method.Locations.FirstOrDefault()), method); diff --git a/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/Descriptors.cs b/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/Descriptors.cs index 5ae43a1000f..338e29b27b7 100644 --- a/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/Descriptors.cs +++ b/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/Descriptors.cs @@ -121,13 +121,13 @@ internal class Descriptors public static DiagnosticDescriptor AZC0018 = new DiagnosticDescriptor( nameof(AZC0018), "Invalid protocol method signature.", - "Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types. Protocol methods should not have optional parameters if ambiguity exists between the protocol method and convenience methods.", + "Protocol method should take a RequestContext parameter called `context` and not use a model as parameter or return types.", "Usage", DiagnosticSeverity.Warning, isEnabledByDefault: true, description: null); public static DiagnosticDescriptor AZC0019 = new DiagnosticDescriptor( nameof(AZC0019), "Potential ambiguous call exists.", - "There will be ambiguous call when user calls with required parameters.", + "There will be ambiguous call when user calls with required parameters. All parameters of the protocol method should be required.", "Usage", DiagnosticSeverity.Warning, isEnabledByDefault: true, description: null); #endregion