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