Skip to content

Commit

Permalink
updadte
Browse files Browse the repository at this point in the history
  • Loading branch information
pshao25 committed Sep 26, 2023
1 parent 03a5a93 commit 92c56ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ private static void CheckServiceMethod(ISymbolAnalysisContext context, IMethodSy
if (!lastArgument.IsOptional)
{
var overloadWithCancellationToken = FindMethod(
member.ContainingType.GetMembers(member.Name).OfType<IMethodSymbol>(),
member.TypeParameters,
member.Parameters.RemoveAt(member.Parameters.Length - 1));
member.ContainingType.GetMembers(member.Name).OfType<IMethodSymbol>(),
member.TypeParameters,
member.Parameters.RemoveAt(member.Parameters.Length - 1));

if (overloadWithCancellationToken == null)
{
Expand Down Expand Up @@ -149,11 +149,6 @@ private static void CheckProtocolMethodReturnType(ISymbolAnalysisContext context
{
bool IsValidPageable(ITypeSymbol typeSymbol)
{
if ((!IsOrImplements(typeSymbol, PageableTypeName)) && (!IsOrImplements(typeSymbol, AsyncPageableTypeName)))
{
return false;
}

var pageableTypeSymbol = typeSymbol as INamedTypeSymbol;
if (!pageableTypeSymbol.IsGenericType)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,19 @@ internal class Descriptors
public static DiagnosticDescriptor AZC0017 = new DiagnosticDescriptor(
nameof(AZC0017),
"Invalid convenience method signature.",
"Convenience method shouldn't have parameters with type RequestContent.",
"Convenience methods shouldn't have parameters with the RequestContent type.",
"Usage", DiagnosticSeverity.Warning, isEnabledByDefault: true, description: null);

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 take a RequestContext parameter called `context` and not use a model type in a parameter or return type.",
"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. All parameters of the protocol method should be required.",
"There will be an ambiguous call error when the user calls with only the required parameters. All parameters of the protocol method should be required.",
"Usage", DiagnosticSeverity.Warning, isEnabledByDefault: true, description: null);

public static DiagnosticDescriptor AZC0020 = new DiagnosticDescriptor(
Expand Down

0 comments on commit 92c56ee

Please sign in to comment.