public void HandleEventFieldDeclaration(SyntaxNodeAnalysisContext context) { if (context.GetDocumentationMode() != DocumentationMode.Diagnose) { 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 && this.NeedsComment(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)); } } } }