File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -3095,18 +3095,31 @@ public override void VisitParenthesizedExpression(ParenthesizedExpressionSyntax
30953095 public override void VisitCastExpression ( CastExpressionSyntax node )
30963096 {
30973097 ChildSyntaxList nodesAndTokens = node . ChildNodesAndTokens ( ) ;
3098+
3099+ bool skipTokens = false ;
30983100
30993101 for ( int i = 0 ; i < nodesAndTokens . Count ; i ++ )
31003102 {
31013103 SyntaxNode ? asNode = nodesAndTokens [ i ] . AsNode ( ) ;
3104+
3105+ if ( skipTokens )
3106+ {
3107+ if ( asNode != null )
3108+ continue ;
3109+
3110+ if ( nodesAndTokens [ i ] . AsToken ( ) . Kind ( ) == SyntaxKind . CloseParenToken )
3111+ skipTokens = false ;
3112+
3113+ continue ;
3114+ }
3115+
31023116
31033117 if ( asNode != null )
31043118 {
31053119 SyntaxKind kind = asNode . Kind ( ) ;
31063120
31073121 switch ( kind )
31083122 {
3109- case SyntaxKind . IdentifierName :
31103123 case SyntaxKind . NullableType :
31113124 case SyntaxKind . PredefinedType :
31123125 {
@@ -3115,6 +3128,9 @@ public override void VisitCastExpression(CastExpressionSyntax node)
31153128#endif
31163129 break ;
31173130 }
3131+ case SyntaxKind . IdentifierName :
3132+ VisitIdentifierName ( ( IdentifierNameSyntax ) asNode ) ;
3133+ break ;
31183134 case SyntaxKind . ArgListExpression :
31193135 case SyntaxKind . NumericLiteralExpression :
31203136 case SyntaxKind . StringLiteralExpression :
@@ -3163,6 +3179,10 @@ public override void VisitCastExpression(CastExpressionSyntax node)
31633179 switch ( kind )
31643180 {
31653181 case SyntaxKind . OpenParenToken :
3182+ {
3183+ skipTokens = true ;
3184+ break ;
3185+ }
31663186 case SyntaxKind . CloseParenToken :
31673187 break ;
31683188 default :
You can’t perform that action at this time.
0 commit comments