public static void HandleEventFieldDeclaration(SyntaxNodeAnalysisContext context, StyleCopSettings settings) { if (context.GetDocumentationMode() == DocumentationMode.None) { return; } EventFieldDeclarationSyntax declaration = (EventFieldDeclarationSyntax)context.Node; VariableDeclarationSyntax variableDeclaration = declaration.Declaration; Accessibility declaredAccessibility = declaration.GetDeclaredAccessibility(context.SemanticModel, context.CancellationToken); Accessibility effectiveAccessibility = declaration.GetEffectiveAccessibility(context.SemanticModel, context.CancellationToken); if (variableDeclaration != null && NeedsComment(settings.DocumentationRules, declaration.Kind(), declaration.Parent.Kind(), declaredAccessibility, effectiveAccessibility)) { if (!XmlCommentHelper.HasDocumentation(declaration)) { var locations = variableDeclaration.Variables.Select(v => v.Identifier.GetLocation()); foreach (var location in locations) { context.ReportDiagnostic(Diagnostic.Create(Descriptor, location)); } } } }