-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
If Statement with long expression #34
Comments
Hmmm. I'm definitely not a fan of # 3. # 2 might make sense if we want to make it consistent with things like constructors or long method defintions: public Constructor(
Type arg1,
Type arg2
) {
// logic
} |
I made #2 work, which I'm going to call SpaceBrace (vs NewLineBrace). I see two options
I think I'm leaning towards option 1, because then things are consistent. But I'm not opposed to option 2 either. public void LongMethodNameForceLineBreak(
string oneoneoneoneoneoneoneoneone,
string twotwotwotwotwotwotwotwo,
string threethreethreethreethreethree)
{
if (
longStatementName
&& longerStatementName
&& evenLongerStatementName
&& superLongStatementName
) {
return;
}
} |
changing if, while, foreach and using to use SpaceBrace formatting. closes #34
After working on #58 I'm thinking we go all in on SpaceBrace. const doSomething = (
jasdjklfasjkldflajskdflkasdlfjkasdf,
jalsdfkasdlkfalksflksdf,
kjladslkfasjfkasdfl
) => doSomethingElse(); |
changing if, while, foreach and using to use SpaceBrace formatting. closes #34
This is closed... but the spacebrace in all cases as seen in the screenshot below is seemingly not the way the vast majority of C# is formatted in my experience. Edit: This is not specifically addressed in the MS C# coding conventions but samples basically never use space brace. https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/inside-a-program/coding-conventions |
Currently when an if statement has a long expression, it formats like
I think it should do this
or
This applies to other syntax nodes, like for loops and while loops.
The text was updated successfully, but these errors were encountered: