@@ -370,21 +370,21 @@ private static bool TryGetTextForContextualKeyword(SyntaxToken token, [NotNullWh
370370 case SyntaxKind . PartialKeyword :
371371 if ( token . Parent . GetAncestorOrThis < MethodDeclarationSyntax > ( ) != null )
372372 {
373- text = "partialmethod_CSharpKeyword" ;
373+ text = Keyword ( "partialmethod" ) ;
374374 return true ;
375375 }
376376 else if ( token . Parent . GetAncestorOrThis < TypeDeclarationSyntax > ( ) != null )
377377 {
378- text = "partialtype_CSharpKeyword" ;
378+ text = Keyword ( "partialtype" ) ;
379379 return true ;
380380 }
381381
382382 break ;
383383
384384 case SyntaxKind . WhereKeyword :
385385 text = token . Parent . GetAncestorOrThis < TypeParameterConstraintClauseSyntax > ( ) != null
386- ? "whereconstraint_CSharpKeyword"
387- : "whereclause_CSharpKeyword" ;
386+ ? Keyword ( "whereconstraint" )
387+ : Keyword ( "whereclause" ) ;
388388
389389 return true ;
390390
@@ -411,25 +411,25 @@ private static bool TryGetTextForCombinationKeyword(SyntaxToken token, [NotNullW
411411 {
412412 case SyntaxKind . PrivateKeyword when ModifiersContains ( token , SyntaxKind . ProtectedKeyword ) :
413413 case SyntaxKind . ProtectedKeyword when ModifiersContains ( token , SyntaxKind . PrivateKeyword ) :
414- text = "privateprotected_CSharpKeyword" ;
414+ text = Keyword ( "privateprotected" ) ;
415415 return true ;
416416
417417 case SyntaxKind . ProtectedKeyword when ModifiersContains ( token , SyntaxKind . InternalKeyword ) :
418418 case SyntaxKind . InternalKeyword when ModifiersContains ( token , SyntaxKind . ProtectedKeyword ) :
419- text = "protectedinternal_CSharpKeyword" ;
419+ text = Keyword ( "protectedinternal" ) ;
420420 return true ;
421421
422422 case SyntaxKind . UsingKeyword when token . Parent is UsingDirectiveSyntax :
423423 text = token . GetNextToken ( ) . IsKind ( SyntaxKind . StaticKeyword )
424- ? "using-static_CSharpKeyword"
425- : "using_CSharpKeyword" ;
424+ ? Keyword ( "using-static" )
425+ : Keyword ( "using" ) ;
426426 return true ;
427427 case SyntaxKind . StaticKeyword when token . Parent is UsingDirectiveSyntax :
428- text = "using-static_CSharpKeyword" ;
428+ text = Keyword ( "using-static" ) ;
429429 return true ;
430430 case SyntaxKind . ReturnKeyword when token . Parent . IsKind ( SyntaxKind . YieldReturnStatement ) :
431431 case SyntaxKind . BreakKeyword when token . Parent . IsKind ( SyntaxKind . YieldBreakStatement ) :
432- text = "yield_CSharpKeyword" ;
432+ text = Keyword ( "yield" ) ;
433433 return true ;
434434 }
435435
@@ -448,13 +448,13 @@ private static bool TryGetTextForKeyword(SyntaxToken token, [NotNullWhen(true)]
448448 {
449449 if ( token . GetAncestor < FromClauseSyntax > ( ) != null )
450450 {
451- text = "from_CSharpKeyword" ;
451+ text = Keyword ( "from" ) ;
452452 return true ;
453453 }
454454
455455 if ( token . GetAncestor < JoinClauseSyntax > ( ) != null )
456456 {
457- text = "join_CSharpKeyword" ;
457+ text = Keyword ( "join" ) ;
458458 return true ;
459459 }
460460 }
@@ -513,13 +513,13 @@ private static bool TryGetTextForKeyword(SyntaxToken token, [NotNullWhen(true)]
513513 if ( token . ValueText == "var" && token . IsKind ( SyntaxKind . IdentifierToken ) &&
514514 token . Parent ? . Parent is VariableDeclarationSyntax declaration && token . Parent == declaration . Type )
515515 {
516- text = "var_CSharpKeyword" ;
516+ text = Keyword ( "var" ) ;
517517 return true ;
518518 }
519519
520520 if ( token . IsTypeNamedDynamic ( ) )
521521 {
522- text = "dynamic_CSharpKeyword" ;
522+ text = Keyword ( "dynamic" ) ;
523523 return true ;
524524 }
525525
0 commit comments