-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Demo of changes that CSharpier makes #1
base: main
Are you sure you want to change the base?
Conversation
var res = 0 | ||
+ 123 // permitted in C# 1.0 and later | ||
+ 1_2_3 // permitted in C# 7.0 and later | ||
+ 0x1_2_3 // permitted in C# 7.0 and later | ||
+ 0b101 // binary literals added in C# 7.0 | ||
+ 0b1_0_1 // permitted in C# 7.0 and later | ||
|
||
// in C# 7.2, _ is permitted after the `0x` or `0b` | ||
+ 0x_1_2 // permitted in C# 7.2 and later | ||
+ 0b_1_0_1 // permitted in C# 7.2 and later |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we realign the comments and then re-run, would we lose the alignment again? Or is this only sensitive to the improper leading whitespace
var dictionaryInitializer = new Dictionary<int, string> { { 1, "" }, { 2, "a" } }; | ||
float[] a = new float[] { 0f, 1.1f }; | ||
int[,,] cube = { | ||
{ { 111, 112 }, { 121, 122 } }, | ||
{ { 211, 212 }, { 221, 222 } } | ||
}; | ||
int[,,] cube = { { { 111, 112 }, { 121, 122 } }, { { 211, 212 }, { 221, 222 } } }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... is this intended to force us to encapsulate object construction? Is there any way to have dictionary initialization span multiple lines?
); | ||
var task = Task.Factory.StartNew(async () => | ||
{ | ||
return await new WebClient().DownloadStringTaskAsync("http://example.com"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it allowed to do:
return await new WebClient()
.DownloadStringTaskAsync("http://example.com");
@hydrojumbo : CSharpier is opinionated. The only options are:
So the answer to all of your questions is a very firm: You can't make any changes to the formatting it applies. |
This pull request merely shows the changes that CSharpier makes to a given piece of code.
For reference: https://github.com/belav/csharpier, and https://github.com/belav/csharpier/blob/master/Src/CSharpier.Tests/Samples/AllInOne.cst