-
-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleaning up indentation on raw string literals (#977)
* This isn't correct, but I wanna see what 3rd party code does closes #975 * Getting a basic version of this working * Handling everything except for tabs * format files * Fixing issues with tabs + passing options around * self code review * more tweaks * formatting files --------- Co-authored-by: Lasath Fernando <devel@lasath.org>
- Loading branch information
1 parent
331da7d
commit deb6759
Showing
19 changed files
with
196 additions
and
35 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
27 changes: 27 additions & 0 deletions
27
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RawStringLiterals.test
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,27 @@ | ||
var someString = """ | ||
Indent based on previous line | ||
"""; | ||
|
||
var someString = """ | ||
Indent based on previous line | ||
This should stay indented | ||
"""; | ||
|
||
var doNotIndentIfEndDelimiterIsAtZero = """ | ||
Keep This | ||
Where It | ||
Is | ||
"""; | ||
|
||
var someOneWantsThisMuchIndentation = """ | ||
<element attr="content"> | ||
<body> | ||
</body> | ||
</element> | ||
"""; | ||
|
||
var whatAboutWhiteSpace = """ | ||
Four Spaces | ||
|
||
That last line is six | ||
"""; |
3 changes: 3 additions & 0 deletions
3
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RawStringLiterals_MovesIndent.expected.test
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,3 @@ | ||
var someString = """ | ||
Indent based on previous line | ||
"""; |
3 changes: 3 additions & 0 deletions
3
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RawStringLiterals_MovesIndent.test
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,3 @@ | ||
var someString = """ | ||
Indent based on previous line | ||
"""; |
3 changes: 3 additions & 0 deletions
3
...rpier.Tests/FormattingTests/TestFiles/cs/RawStringLiterals_MovesIndent_Tabs.expected.test
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,3 @@ | ||
var someString = """ | ||
Indent based on previous line | ||
"""; |
3 changes: 3 additions & 0 deletions
3
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RawStringLiterals_MovesIndent_Tabs.test
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,3 @@ | ||
var someString = """ | ||
Indent based on previous line | ||
"""; |
27 changes: 27 additions & 0 deletions
27
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RawStringLiterals_Tabs.test
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,27 @@ | ||
var someString = """ | ||
Indent based on previous line | ||
"""; | ||
|
||
var someString = """ | ||
Indent based on previous line | ||
This should stay indented | ||
"""; | ||
|
||
var doNotIndentIfEndDelimiterIsAtZero = """ | ||
Keep This | ||
Where It | ||
Is | ||
"""; | ||
|
||
var someOneWantsThisMuchIndentation = """ | ||
<element attr="content"> | ||
<body> | ||
</body> | ||
</element> | ||
"""; | ||
|
||
var whatAboutWhiteSpace = """ | ||
One Tab | ||
|
||
That last line is two tabs | ||
"""; |
5 changes: 5 additions & 0 deletions
5
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RawStringLiterals_TrimExtra.expected.test
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,5 @@ | ||
var whatAboutWhiteSpace = """ | ||
Four Spaces | ||
|
||
That last line is only two | ||
"""; |
5 changes: 5 additions & 0 deletions
5
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RawStringLiterals_TrimExtra.test
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,5 @@ | ||
var whatAboutWhiteSpace = """ | ||
Four Spaces | ||
|
||
That last line is only two | ||
"""; |
5 changes: 5 additions & 0 deletions
5
...harpier.Tests/FormattingTests/TestFiles/cs/RawStringLiterals_TrimExtra_Tabs.expected.test
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,5 @@ | ||
var whatAboutWhiteSpace = """ | ||
One Tab | ||
|
||
That last line is one tab | ||
"""; |
5 changes: 5 additions & 0 deletions
5
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/RawStringLiterals_TrimExtra_Tabs.test
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,5 @@ | ||
var whatAboutWhiteSpace = """ | ||
One Tab | ||
|
||
That last line is one tab | ||
"""; |
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
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,3 @@ | ||
namespace CSharpier.DocTypes; | ||
|
||
internal class HardLineNoTrim : HardLine { } |
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