Skip to content

Commit

Permalink
Resolve issue on non-MethodDeclaration kind
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthurvdv committed Oct 27, 2023
1 parent 1b584bb commit 9a11aeb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Design/Rule0028CodeNavigabilityOnEventSubscribers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ private void CodeNavigabilityOnEventSubscribers(CodeBlockAnalysisContext context
if (context.OwningSymbol.GetContainingObjectTypeSymbol().IsObsoletePending || context.OwningSymbol.GetContainingObjectTypeSymbol().IsObsoleteRemoved) return;
if (context.OwningSymbol.IsObsoletePending || context.OwningSymbol.IsObsoleteRemoved) return;

if (!context.CodeBlock.IsKind(SyntaxKind.MethodDeclaration)) return;
var SyntaxList = ((MethodDeclarationSyntax)context.CodeBlock).Attributes.Where(value => value.GetIdentifierOrLiteralValue().ToUpper() == "EVENTSUBSCRIBER");

foreach (var Syntax in SyntaxList)
{
if (Syntax.ArgumentList.Arguments[2].IsKind(SyntaxKind.LiteralAttributeArgument))
Expand Down

0 comments on commit 9a11aeb

Please sign in to comment.