-
-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing a number of edge cases with preprocessor directives
closes #660
- Loading branch information
Showing
7 changed files
with
207 additions
and
56 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
Src/CSharpier.Tests/FormattingTests/TestFiles/Directives_AddAndRemoveLines.cst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
public class ClassName | ||
{ | ||
#if NET6_0_OR_GREATER | ||
public void Method1() { } | ||
#endif | ||
|
||
|
||
public void RemoveLineAbove() { } | ||
|
||
#if NET6_0_OR_GREATER | ||
public void Method2() { } | ||
#endif | ||
public void AddLineAbove() { } | ||
|
||
|
||
#if NET6_0_OR_GREATER | ||
public void RemoveLineAbove() { } | ||
#endif | ||
|
||
public void Method3() { } | ||
#if NET6_0_OR_GREATER | ||
public void AddLineAbove() { } | ||
#endif | ||
|
||
public void Method4() { } | ||
|
||
#if NET6_0_OR_GREATER | ||
public void RemoveLineBelow() { } | ||
#endif | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
Src/CSharpier.Tests/FormattingTests/TestFiles/Directives_AddAndRemoveLines.expected.cst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
public class ClassName | ||
{ | ||
#if NET6_0_OR_GREATER | ||
public void Method1() { } | ||
#endif | ||
|
||
public void RemoveLineAbove() { } | ||
|
||
#if NET6_0_OR_GREATER | ||
public void Method2() { } | ||
#endif | ||
|
||
public void AddLineAbove() { } | ||
|
||
#if NET6_0_OR_GREATER | ||
public void RemoveLineAbove() { } | ||
#endif | ||
|
||
public void Method3() { } | ||
|
||
#if NET6_0_OR_GREATER | ||
public void AddLineAbove() { } | ||
#endif | ||
|
||
public void Method4() { } | ||
|
||
#if NET6_0_OR_GREATER | ||
public void RemoveLineBelow() { } | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,31 @@ | ||
using System.Web.Http; | ||
public class ClassName | ||
{ | ||
#if NET6_0_OR_GREATER | ||
public void Method1() { } | ||
#endif | ||
|
||
|
||
public void RemoveLineAbove() { } | ||
|
||
#if NET6_0_OR_GREATER | ||
public void Method2() { } | ||
#endif | ||
public void AddLineAbove() { } | ||
|
||
|
||
#if NET6_0_OR_GREATER | ||
public void RemoveLineAbove() { } | ||
#endif | ||
|
||
public void Method3() { } | ||
#if NET6_0_OR_GREATER | ||
public void AddLineAbove() { } | ||
#endif | ||
|
||
#if KEEP_LINE_ABOVE | ||
using System.Web.Http; | ||
public void Method4() { } | ||
|
||
#if NET6_0_OR_GREATER | ||
public void RemoveLineBelow() { } | ||
#endif | ||
|
||
namespace Namespace { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters