File tree Expand file tree Collapse file tree 4 files changed +38
-4
lines changed
FormattingTests/TestFiles/cs Expand file tree Collapse file tree 4 files changed +38
-4
lines changed Original file line number Diff line number Diff line change 3636 <DependentUpon >$([System.String]::Copy(%(Filename)).Replace('.expected', '.test'))</DependentUpon >
3737 </Content >
3838 </ItemGroup >
39- <ItemGroup >
40- <Folder Include =" FormattingTests\TestFiles\csproj\" />
41- </ItemGroup >
4239</Project >
Original file line number Diff line number Diff line change 1+ public class ClassName
2+ {
3+ /// <summary>Remove the lines after the summary</summary>
4+ public bool SomeField1;
5+
6+ /* Don't remove this line */
7+
8+ public bool SomeField2;
9+
10+ // Don't remove this line
11+
12+ public bool SomeField2;
13+ }
Original file line number Diff line number Diff line change 1+ public class ClassName
2+ {
3+ /// <summary>Remove the lines after the summary</summary>
4+
5+ public bool SomeField1;
6+
7+ /* Don't remove this line */
8+
9+ public bool SomeField2;
10+
11+ // Don't remove this line
12+
13+ public bool SomeField2;
14+ }
Original file line number Diff line number Diff line change @@ -250,7 +250,17 @@ private static Doc PrivatePrintLeadingTrivia(
250250 {
251251 printNewLines = false ;
252252 }
253- docs . Add ( Doc . HardLineSkipBreakIfFirstInGroup ) ;
253+
254+ if (
255+ ! (
256+ docs . Count > 1
257+ && docs [ ^ 1 ] == Doc . HardLineSkipBreakIfFirstInGroup
258+ && docs [ ^ 2 ] is LeadingComment { Type : CommentType . SingleLine }
259+ )
260+ )
261+ {
262+ docs . Add ( Doc . HardLineSkipBreakIfFirstInGroup ) ;
263+ }
254264 }
255265 if ( kind is not ( SyntaxKind . EndOfLineTrivia or SyntaxKind . WhitespaceTrivia ) )
256266 {
You can’t perform that action at this time.
0 commit comments