@@ -54,17 +54,16 @@ internal class SA1627DocumentationTextMustNotBeEmpty : DiagnosticAnalyzer
5454 private static readonly DiagnosticDescriptor Descriptor =
5555 new DiagnosticDescriptor ( DiagnosticId , Title , MessageFormat , AnalyzerCategory . DocumentationRules , DiagnosticSeverity . Warning , AnalyzerConstants . DisabledNoTests , Description , HelpLink ) ;
5656
57- /// <inheritdoc/>
58- public override ImmutableArray < DiagnosticDescriptor > SupportedDiagnostics { get ; } =
59- ImmutableArray . Create ( Descriptor ) ;
60-
61- private static string [ ] elementsToCheck =
62- {
57+ private static readonly ImmutableArray < string > ElementsToCheck =
58+ ImmutableArray . Create (
6359 XmlCommentHelper . RemarksXmlTag ,
6460 XmlCommentHelper . PermissionXmlTag ,
6561 XmlCommentHelper . ExceptionXmlTag ,
66- XmlCommentHelper . ExampleXmlTag
67- } ;
62+ XmlCommentHelper . ExampleXmlTag ) ;
63+
64+ /// <inheritdoc/>
65+ public override ImmutableArray < DiagnosticDescriptor > SupportedDiagnostics { get ; } =
66+ ImmutableArray . Create ( Descriptor ) ;
6867
6968 /// <inheritdoc/>
7069 public override void Initialize ( AnalysisContext context )
@@ -84,7 +83,7 @@ private static void HandleXmlElement(SyntaxNodeAnalysisContext context)
8483
8584 var name = element . StartTag ? . Name ;
8685
87- if ( elementsToCheck . Contains ( name . ToString ( ) ) && XmlCommentHelper . IsConsideredEmpty ( element ) )
86+ if ( ElementsToCheck . Contains ( name . ToString ( ) ) && XmlCommentHelper . IsConsideredEmpty ( element ) )
8887 {
8988 context . ReportDiagnostic ( Diagnostic . Create ( Descriptor , element . GetLocation ( ) , name . ToString ( ) ) ) ;
9089 }
@@ -94,7 +93,7 @@ private static void HandleXmlEmptyElement(SyntaxNodeAnalysisContext context)
9493 {
9594 var element = ( XmlEmptyElementSyntax ) context . Node ;
9695
97- if ( elementsToCheck . Contains ( element . Name . ToString ( ) ) )
96+ if ( ElementsToCheck . Contains ( element . Name . ToString ( ) ) )
9897 {
9998 context . ReportDiagnostic ( Diagnostic . Create ( Descriptor , element . GetLocation ( ) , element . Name . ToString ( ) ) ) ;
10099 }
0 commit comments