This repository was archived by the owner on Jul 12, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed
src/Microsoft.DotNet.CodeFormatting Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,12 @@ namespace Microsoft.DotNet.CodeFormatting
1010{
1111 internal static class Extensions
1212 {
13- public static IEnumerable < SyntaxTrivia > AddTwoNewLines ( this IEnumerable < SyntaxTrivia > trivia )
13+ internal static IEnumerable < SyntaxTrivia > AddTwoNewLines ( this IEnumerable < SyntaxTrivia > trivia )
1414 {
1515 return trivia . Concat ( new [ ] { SyntaxFactory . CarriageReturnLineFeed , SyntaxFactory . CarriageReturnLineFeed } ) ;
1616 }
1717
18- public static IEnumerable < SyntaxTrivia > AddNewLine ( this IEnumerable < SyntaxTrivia > trivia )
18+ internal static IEnumerable < SyntaxTrivia > AddNewLine ( this IEnumerable < SyntaxTrivia > trivia )
1919 {
2020 return trivia . Concat ( new [ ] { SyntaxFactory . CarriageReturnLineFeed } ) ;
2121 }
Original file line number Diff line number Diff line change 1010namespace Microsoft . DotNet . CodeFormatting . Filters
1111{
1212 [ Export ( typeof ( IFormattingFilter ) ) ]
13- internal sealed class IgnoreDesignerGeneratedCodeFilter : IFormattingFilter
13+ internal sealed class IgnoreGeneratedFilesFilter : IFormattingFilter
1414 {
1515 public bool ShouldBeProcessed ( Document document )
1616 {
@@ -19,8 +19,13 @@ public bool ShouldBeProcessed(Document document)
1919 return true ;
2020 }
2121
22- var isDesignerGenerated = document . FilePath . EndsWith ( ".Designer.cs" , StringComparison . OrdinalIgnoreCase ) ;
23- return ! isDesignerGenerated ;
22+ if ( document . FilePath . EndsWith ( ".Designer.cs" , StringComparison . OrdinalIgnoreCase ) ||
23+ document . FilePath . EndsWith ( ".Generated.cs" , StringComparison . OrdinalIgnoreCase ) )
24+ {
25+ return false ;
26+ }
27+
28+ return true ;
2429 }
2530 }
2631}
Original file line number Diff line number Diff line change 8080 <Compile Include =" IFormattingEngine.cs" />
8181 <Compile Include =" IFormattingFilter.cs" />
8282 <Compile Include =" IFormattingRule.cs" />
83- <Compile Include =" Filters\IgnoreDesignerGeneratedCodeFilter .cs" />
83+ <Compile Include =" Filters\IgnoreGeneratedFilesFilter .cs" />
8484 <Compile Include =" Options.cs" />
8585 <Compile Include =" RuleOrderAttribute.cs" />
8686 <Compile Include =" Properties\AssemblyInfo.cs" />
You can’t perform that action at this time.
0 commit comments