@@ -119,7 +119,7 @@ private static void AnalyzeSummaryElement(SyntaxNodeAnalysisContext context, Xml
119119 var textElement = summaryElement . Content . FirstOrDefault ( ) as XmlTextSyntax ;
120120 var text = textElement == null ? string . Empty : XmlCommentHelper . GetText ( textElement , true ) . TrimStart ( ) ;
121121
122- bool startsWithGetOrSet = text . StartsWith ( startingTextGetsOrSets , StringComparison . Ordinal ) ;
122+ bool startsWithGetOrSet = text . StartsWith ( startingTextGetsOrSets , StringComparison . OrdinalIgnoreCase ) ;
123123 bool getterVisible , setterVisible ;
124124 if ( getter != null && setter != null )
125125 {
@@ -217,6 +217,16 @@ private static void AnalyzeSummaryElement(SyntaxNodeAnalysisContext context, Xml
217217 if ( ! startsWithGetOrSet )
218218 {
219219 diagnosticProperties . Add ( ExpectedTextKey , startingTextGetsOrSets ) ;
220+
221+ if ( text . StartsWith ( startingTextGets , StringComparison . OrdinalIgnoreCase ) )
222+ {
223+ diagnosticProperties . Add ( TextToRemoveKey , text . Substring ( 0 , startingTextGets . Length ) ) ;
224+ }
225+ else if ( text . StartsWith ( startingTextSets , StringComparison . OrdinalIgnoreCase ) )
226+ {
227+ diagnosticProperties . Add ( TextToRemoveKey , text . Substring ( 0 , startingTextSets . Length ) ) ;
228+ }
229+
220230 context . ReportDiagnostic ( Diagnostic . Create ( SA1623Descriptor , diagnosticLocation , diagnosticProperties . ToImmutable ( ) , startingTextGetsOrSets ) ) ;
221231 }
222232 }
@@ -228,7 +238,7 @@ private static void AnalyzeSummaryElement(SyntaxNodeAnalysisContext context, Xml
228238 diagnosticProperties . Add ( TextToRemoveKey , startingTextGetsOrSets ) ;
229239 context . ReportDiagnostic ( Diagnostic . Create ( SA1624Descriptor , diagnosticLocation , diagnosticProperties . ToImmutable ( ) , "get" , startingTextGets ) ) ;
230240 }
231- else if ( ! text . StartsWith ( startingTextGets , StringComparison . Ordinal ) )
241+ else if ( ! text . StartsWith ( startingTextGets , StringComparison . OrdinalIgnoreCase ) )
232242 {
233243 diagnosticProperties . Add ( ExpectedTextKey , startingTextGets ) ;
234244 context . ReportDiagnostic ( Diagnostic . Create ( SA1623Descriptor , diagnosticLocation , diagnosticProperties . ToImmutable ( ) , startingTextGets ) ) ;
@@ -243,7 +253,7 @@ private static void AnalyzeSummaryElement(SyntaxNodeAnalysisContext context, Xml
243253 diagnosticProperties . Add ( TextToRemoveKey , startingTextGetsOrSets ) ;
244254 context . ReportDiagnostic ( Diagnostic . Create ( SA1624Descriptor , diagnosticLocation , diagnosticProperties . ToImmutable ( ) , "set" , startingTextSets ) ) ;
245255 }
246- else if ( ! text . StartsWith ( startingTextSets , StringComparison . Ordinal ) )
256+ else if ( ! text . StartsWith ( startingTextSets , StringComparison . OrdinalIgnoreCase ) )
247257 {
248258 diagnosticProperties . Add ( ExpectedTextKey , startingTextSets ) ;
249259 context . ReportDiagnostic ( Diagnostic . Create ( SA1623Descriptor , diagnosticLocation , diagnosticProperties . ToImmutable ( ) , startingTextSets ) ) ;
0 commit comments