@@ -140,6 +140,7 @@ FormattingContext context
140140 var systemUsings = new List < UsingData > ( ) ;
141141 var aliasNameUsings = new List < UsingData > ( ) ;
142142 var regularUsings = new List < UsingData > ( ) ;
143+ var staticSystemUsings = new List < UsingData > ( ) ;
143144 var staticUsings = new List < UsingData > ( ) ;
144145 var aliasUsings = new List < UsingData > ( ) ;
145146 var directiveGroup = new List < UsingData > ( ) ;
@@ -203,7 +204,14 @@ FormattingContext context
203204 }
204205 else if ( usingDirective . StaticKeyword . RawSyntaxKind ( ) != SyntaxKind . None )
205206 {
206- staticUsings . Add ( usingData ) ;
207+ if ( usingDirective . Name is not null && IsSystemName ( usingDirective . Name ) )
208+ {
209+ staticSystemUsings . Add ( usingData ) ;
210+ }
211+ else
212+ {
213+ staticUsings . Add ( usingData ) ;
214+ }
207215 }
208216 else if ( usingDirective . Alias is not null )
209217 {
@@ -230,6 +238,7 @@ FormattingContext context
230238 yield return systemUsings . OrderBy ( o => o . Using , Comparer ) . ToList ( ) ;
231239 yield return aliasNameUsings . OrderBy ( o => o . Using , Comparer ) . ToList ( ) ;
232240 yield return regularUsings . OrderBy ( o => o . Using , Comparer ) . ToList ( ) ;
241+ yield return staticSystemUsings . OrderBy ( o => o . Using , Comparer ) . ToList ( ) ;
233242 yield return staticUsings . OrderBy ( o => o . Using , Comparer ) . ToList ( ) ;
234243 yield return aliasUsings . OrderBy ( o => o . Using , Comparer ) . ToList ( ) ;
235244 // we need the directive groups at the end, the #endif directive
0 commit comments