@@ -130,7 +130,10 @@ private static void AnalyzeSummaryElement(SyntaxNodeAnalysisContext context, Xml
130130 var textElement = summaryElement . Content . FirstOrDefault ( ) as XmlTextSyntax ;
131131 var text = textElement == null ? string . Empty : XmlCommentHelper . GetText ( textElement , true ) . TrimStart ( ) ;
132132
133- bool startsWithGetOrSet = text . StartsWith ( startingTextGetsOrSets , StringComparison . OrdinalIgnoreCase ) ;
133+ bool startsWithGetsOrSets = text . StartsWith ( startingTextGetsOrSets , StringComparison . OrdinalIgnoreCase ) ;
134+ bool startsWithGets = text . StartsWith ( startingTextGets , StringComparison . OrdinalIgnoreCase ) ;
135+ bool startsWithSets = text . StartsWith ( startingTextSets , StringComparison . OrdinalIgnoreCase ) ;
136+
134137 bool getterVisible , setterVisible ;
135138 if ( getter != null && setter != null )
136139 {
@@ -225,15 +228,15 @@ private static void AnalyzeSummaryElement(SyntaxNodeAnalysisContext context, Xml
225228 {
226229 if ( setterVisible )
227230 {
228- if ( ! startsWithGetOrSet )
231+ if ( ! startsWithGetsOrSets )
229232 {
230233 diagnosticProperties . Add ( ExpectedTextKey , startingTextGetsOrSets ) ;
231234
232- if ( text . StartsWith ( startingTextGets , StringComparison . OrdinalIgnoreCase ) )
235+ if ( startsWithGets )
233236 {
234237 diagnosticProperties . Add ( TextToRemoveKey , text . Substring ( 0 , startingTextGets . Length ) ) ;
235238 }
236- else if ( text . StartsWith ( startingTextSets , StringComparison . OrdinalIgnoreCase ) )
239+ else if ( startsWithSets )
237240 {
238241 diagnosticProperties . Add ( TextToRemoveKey , text . Substring ( 0 , startingTextSets . Length ) ) ;
239242 }
@@ -243,13 +246,13 @@ private static void AnalyzeSummaryElement(SyntaxNodeAnalysisContext context, Xml
243246 }
244247 else
245248 {
246- if ( startsWithGetOrSet )
249+ if ( startsWithGetsOrSets )
247250 {
248251 diagnosticProperties . Add ( ExpectedTextKey , startingTextGets ) ;
249252 diagnosticProperties . Add ( TextToRemoveKey , startingTextGetsOrSets ) ;
250253 context . ReportDiagnostic ( Diagnostic . Create ( SA1624Descriptor , diagnosticLocation , diagnosticProperties . ToImmutable ( ) , "get" , startingTextGets ) ) ;
251254 }
252- else if ( ! text . StartsWith ( startingTextGets , StringComparison . OrdinalIgnoreCase ) )
255+ else if ( ! startsWithGets )
253256 {
254257 diagnosticProperties . Add ( ExpectedTextKey , startingTextGets ) ;
255258 context . ReportDiagnostic ( Diagnostic . Create ( SA1623Descriptor , diagnosticLocation , diagnosticProperties . ToImmutable ( ) , startingTextGets ) ) ;
@@ -258,13 +261,13 @@ private static void AnalyzeSummaryElement(SyntaxNodeAnalysisContext context, Xml
258261 }
259262 else if ( setterVisible )
260263 {
261- if ( startsWithGetOrSet )
264+ if ( startsWithGetsOrSets )
262265 {
263266 diagnosticProperties . Add ( ExpectedTextKey , startingTextSets ) ;
264267 diagnosticProperties . Add ( TextToRemoveKey , startingTextGetsOrSets ) ;
265268 context . ReportDiagnostic ( Diagnostic . Create ( SA1624Descriptor , diagnosticLocation , diagnosticProperties . ToImmutable ( ) , "set" , startingTextSets ) ) ;
266269 }
267- else if ( ! text . StartsWith ( startingTextSets , StringComparison . OrdinalIgnoreCase ) )
270+ else if ( ! startsWithSets )
268271 {
269272 diagnosticProperties . Add ( ExpectedTextKey , startingTextSets ) ;
270273 context . ReportDiagnostic ( Diagnostic . Create ( SA1623Descriptor , diagnosticLocation , diagnosticProperties . ToImmutable ( ) , startingTextSets ) ) ;
0 commit comments