Skip to content

Commit bde958b

Browse files
committed
Fix state when deleting leading whitespace from moved trivia
1 parent 4b8e81b commit bde958b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/OrderingRules/UsingCodeFixProvider.UsingsSorter.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,10 @@ private List<UsingDirectiveSyntax> GenerateUsings(List<UsingDirectiveSyntax> usi
241241
{
242242
if (triviaToMove[m].IsKind(SyntaxKind.WhitespaceTrivia))
243243
{
244+
// Remove the trivia and analyze the current position again
244245
triviaToMove.RemoveAt(m);
245246
m--;
247+
atStartOfLine = true;
246248
}
247249
}
248250
else

0 commit comments

Comments
 (0)