-
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding support for a ranged csharpier-ignore (#687)
* Initial POC for ranged ignore closes #678 * Gettings ranged ignore working with members of types * Adding more tests, fixing a minor issue * formatting file * Updating documents
- Loading branch information
Showing
11 changed files
with
306 additions
and
18 deletions.
There are no files selected for viewing
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
79 changes: 79 additions & 0 deletions
79
Src/CSharpier.Tests/FormattingTests/TestFiles/CSharpierIgnore.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,79 @@ | ||
// csharpier-ignore | ||
public class Unformatted { } | ||
|
||
public class ClassName | ||
{ | ||
// csharpier-ignore | ||
private string unformatted; | ||
|
||
public void MethodName() | ||
{ | ||
// csharpier-ignore | ||
var unformatted = true; | ||
|
||
if (true) | ||
{ | ||
// csharpier-ignore | ||
var unformatted = true; | ||
} | ||
} | ||
|
||
void MethodName() | ||
{ | ||
var formatMe = true; | ||
// csharpier-ignore-start | ||
var unformatted = true; | ||
var unformatted = true; | ||
// csharpier-ignore-end | ||
var formatMe = true; | ||
} | ||
|
||
void MethodName() | ||
{ | ||
var formatMe = true; | ||
// csharpier-ignore-start | ||
var unformatted = true; | ||
var unformatted = true; | ||
// csharpier-ignore-end | ||
} | ||
|
||
void MethodName() | ||
{ | ||
var formatMe = true; | ||
// csharpier-ignore-start | ||
var unformatted = true; | ||
var unformatted = true; | ||
} | ||
} | ||
|
||
public class ClassName2 | ||
{ | ||
// csharpier-ignore-start | ||
private string unformatted1; | ||
// csharpier-ignore-end | ||
|
||
private string formatMe; | ||
// csharpier-ignore-start | ||
private string noNewLine; | ||
// csharpier-ignore-end | ||
|
||
// csharpier-ignore-start | ||
private string keepNewLine; | ||
// csharpier-ignore-end | ||
|
||
public void Method() | ||
{ | ||
// csharpier-ignore-start | ||
string unformatted1; | ||
// csharpier-ignore-end | ||
|
||
string formatMe; | ||
// csharpier-ignore-start | ||
string noNewLine; | ||
// csharpier-ignore-end | ||
|
||
// csharpier-ignore-start | ||
string keepNewLine; | ||
// csharpier-ignore-end | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
Src/CSharpier.Tests/FormattingTests/TestFiles/CSharpierIgnore_CompilationUnit.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,8 @@ | ||
namespace Namespace | ||
{ | ||
// csharpier-ignore-start | ||
public class Unformatted { } | ||
// csharpier-ignore-end | ||
|
||
public class FormatMe { } | ||
} |
8 changes: 8 additions & 0 deletions
8
Src/CSharpier.Tests/FormattingTests/TestFiles/CSharpierIgnore_CompilationUnit.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,8 @@ | ||
namespace Namespace | ||
{ | ||
// csharpier-ignore-start | ||
public class Unformatted { } | ||
// csharpier-ignore-end | ||
|
||
public class FormatMe { } | ||
} |
19 changes: 19 additions & 0 deletions
19
Src/CSharpier.Tests/FormattingTests/TestFiles/CSharpierIgnore_TopLevel.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,19 @@ | ||
using System; | ||
|
||
// csharpier-ignore-start | ||
string unformatted1; | ||
// csharpier-ignore-end | ||
|
||
string formatMe; | ||
// csharpier-ignore-start | ||
string noNewLine; | ||
// csharpier-ignore-end | ||
|
||
// csharpier-ignore-start | ||
string keepNewLine; | ||
// csharpier-ignore-end | ||
|
||
|
||
// csharpier-ignore-start | ||
string removeNewLine; | ||
// csharpier-ignore-end |
19 changes: 19 additions & 0 deletions
19
Src/CSharpier.Tests/FormattingTests/TestFiles/CSharpierIgnore_TopLevel.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,19 @@ | ||
using System; | ||
|
||
// csharpier-ignore-start | ||
string unformatted1; | ||
// csharpier-ignore-end | ||
|
||
string formatMe; | ||
// csharpier-ignore-start | ||
string noNewLine; | ||
// csharpier-ignore-end | ||
|
||
// csharpier-ignore-start | ||
string keepNewLine; | ||
// csharpier-ignore-end | ||
|
||
|
||
// csharpier-ignore-start | ||
string removeNewLine; | ||
// csharpier-ignore-end |
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
Oops, something went wrong.