This repository was archived by the owner on Jul 12, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/Microsoft.DotNet.CodeFormatting/Rules Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -110,31 +110,31 @@ private static string GetNewSymbolName(ISymbol symbol)
110
110
private async Task < Solution > CleanSolutionAsync ( Solution solution , CancellationToken cancellationToken )
111
111
{
112
112
var documentIdsToProcess = solution . Projects . SelectMany ( p => p . DocumentIds ) . ToList ( ) ;
113
-
113
+ const string rename = "Rename" ;
114
114
foreach ( var documentId in documentIdsToProcess )
115
115
{
116
116
var root = await solution . GetDocument ( documentId ) . GetSyntaxRootAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
117
117
118
118
while ( true )
119
119
{
120
- var renameNodes = root . DescendantNodes ( descendIntoTrivia : true ) . Where ( s => s . GetAnnotations ( "Rename" ) . Any ( ) ) ;
120
+ var renameNodes = root . DescendantNodes ( descendIntoTrivia : true ) . Where ( s => s . GetAnnotations ( rename ) . Any ( ) ) ;
121
121
if ( ! renameNodes . Any ( ) )
122
122
{
123
123
break ;
124
124
}
125
125
126
- root = root . ReplaceNode ( renameNodes . First ( ) , renameNodes . First ( ) . WithoutAnnotations ( "Rename" ) ) ;
126
+ root = root . ReplaceNode ( renameNodes . First ( ) , renameNodes . First ( ) . WithoutAnnotations ( rename ) ) ;
127
127
}
128
128
129
129
while ( true )
130
130
{
131
- var renameTokens = root . DescendantTokens ( descendIntoTrivia : true ) . Where ( s => s . GetAnnotations ( "Rename" ) . Any ( ) ) ;
131
+ var renameTokens = root . DescendantTokens ( descendIntoTrivia : true ) . Where ( s => s . GetAnnotations ( rename ) . Any ( ) ) ;
132
132
if ( ! renameTokens . Any ( ) )
133
133
{
134
134
break ;
135
135
}
136
136
137
- root = root . ReplaceToken ( renameTokens . First ( ) , renameTokens . First ( ) . WithoutAnnotations ( "Rename" ) ) ;
137
+ root = root . ReplaceToken ( renameTokens . First ( ) , renameTokens . First ( ) . WithoutAnnotations ( rename ) ) ;
138
138
}
139
139
140
140
solution = solution . WithDocumentSyntaxRoot ( documentId , root ) ;
You can’t perform that action at this time.
0 commit comments