File tree Expand file tree Collapse file tree 2 files changed +38
-5
lines changed
Microsoft.DotNet.CodeFormatting.Tests/Rules
Microsoft.DotNet.CodeFormatting/Rules Expand file tree Collapse file tree 2 files changed +38
-5
lines changed Original file line number Diff line number Diff line change @@ -330,5 +330,38 @@ private void M()
330330
331331 Verify ( source , expected , runFormatter : false ) ;
332332 }
333+
334+ [ Fact ]
335+ public void CSharpHeaderCorrectAfterMovingUsings ( )
336+ {
337+
338+ var source = @"
339+ namespace Microsoft.Build.UnitTests
340+ {
341+ using System;
342+ using System.Reflection;
343+
344+ public class Test
345+ {
346+ public void RequiredRuntimeAttribute()
347+ {}
348+ }
349+ }" ;
350+ var expected = @"// header
351+
352+ using System;
353+ using System.Reflection;
354+
355+ namespace Microsoft.Build.UnitTests
356+ {
357+ public class Test
358+ {
359+ public void RequiredRuntimeAttribute()
360+ { }
361+ }
362+ }" ;
363+
364+ Verify ( source , expected ) ;
365+ }
333366 }
334367}
Original file line number Diff line number Diff line change @@ -13,11 +13,11 @@ namespace Microsoft.DotNet.CodeFormatting.Rules
1313 internal static class SyntaxRuleOrder
1414 {
1515 public const int HasNoCustomCopyrightHeaderFormattingRule = 1 ;
16- public const int CopyrightHeaderRule = 2 ;
17- public const int UsingLocationFormattingRule = 3 ;
18- public const int NewLineAboveFormattingRule = 4 ;
19- public const int BraceNewLineRule = 6 ;
20- public const int NonAsciiChractersAreEscapedInLiterals = 7 ;
16+ public const int UsingLocationFormattingRule = 2 ;
17+ public const int NewLineAboveFormattingRule = 3 ;
18+ public const int BraceNewLineRule = 4 ;
19+ public const int NonAsciiChractersAreEscapedInLiterals = 5 ;
20+ public const int CopyrightHeaderRule = 6 ;
2121 }
2222
2323 // Please keep these values sorted by number, not rule name.
You can’t perform that action at this time.
0 commit comments