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
10
10
{
11
11
internal static class Extensions
12
12
{
13
- public static IEnumerable < SyntaxTrivia > AddTwoNewLines ( this IEnumerable < SyntaxTrivia > trivia )
13
+ internal static IEnumerable < SyntaxTrivia > AddTwoNewLines ( this IEnumerable < SyntaxTrivia > trivia )
14
14
{
15
15
return trivia . Concat ( new [ ] { SyntaxFactory . CarriageReturnLineFeed , SyntaxFactory . CarriageReturnLineFeed } ) ;
16
16
}
17
17
18
- public static IEnumerable < SyntaxTrivia > AddNewLine ( this IEnumerable < SyntaxTrivia > trivia )
18
+ internal static IEnumerable < SyntaxTrivia > AddNewLine ( this IEnumerable < SyntaxTrivia > trivia )
19
19
{
20
20
return trivia . Concat ( new [ ] { SyntaxFactory . CarriageReturnLineFeed } ) ;
21
21
}
Original file line number Diff line number Diff line change 10
10
namespace Microsoft . DotNet . CodeFormatting . Filters
11
11
{
12
12
[ Export ( typeof ( IFormattingFilter ) ) ]
13
- internal sealed class IgnoreDesignerGeneratedCodeFilter : IFormattingFilter
13
+ internal sealed class IgnoreGeneratedFilesFilter : IFormattingFilter
14
14
{
15
15
public bool ShouldBeProcessed ( Document document )
16
16
{
@@ -19,8 +19,13 @@ public bool ShouldBeProcessed(Document document)
19
19
return true ;
20
20
}
21
21
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 ;
24
29
}
25
30
}
26
31
}
Original file line number Diff line number Diff line change 80
80
<Compile Include =" IFormattingEngine.cs" />
81
81
<Compile Include =" IFormattingFilter.cs" />
82
82
<Compile Include =" IFormattingRule.cs" />
83
- <Compile Include =" Filters\IgnoreDesignerGeneratedCodeFilter .cs" />
83
+ <Compile Include =" Filters\IgnoreGeneratedFilesFilter .cs" />
84
84
<Compile Include =" Options.cs" />
85
85
<Compile Include =" RuleOrderAttribute.cs" />
86
86
<Compile Include =" Properties\AssemblyInfo.cs" />
You can’t perform that action at this time.
0 commit comments