Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
pshao25 committed Jul 27, 2023
1 parent 082febc commit 6056a2e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private static void CheckProtocolMethodParameters(ISymbolAnalysisContext context
INamedTypeSymbol type = (INamedTypeSymbol)context.Symbol;
IEnumerable<IMethodSymbol> methodList = type.GetMembers(method.Name).OfType<IMethodSymbol>().Where(member => !SymbolEqualityComparer.Default.Equals(member, method));
ImmutableArray<IParameterSymbol> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 6056a2e

Please sign in to comment.