Skip to content
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

Fixing indentation issues with conditionals inside initializers #534

Merged
merged 7 commits into from
Jan 3, 2022

Conversation

belav
Copy link
Owner

@belav belav commented Dec 30, 2021

closes #529

@belav belav merged commit 9518b48 into master Jan 3, 2022
@belav belav deleted the initializer-indent branch January 3, 2022 18:02
@@ -141,6 +141,27 @@ class ClassName
new Thing { One = 1 },
Two = 2
};

var conditionalsAndInvocations = new List<SomeObject>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn, this whole block looks really good ✨

this.CallSomeMethod________________________________________()
.CallSomeMethod________________________________________(),
someLongCondition___________________________________
&& someLongCondition___________________________________
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we decide not to indent binary operators, again?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case if it were indented, then it would line up with the ?
Maybe #3 below is the way to go? I think there might be some cases where binary operators do get indented.

someLongCondition___________________________________
&& someLongCondition___________________________________
    ? one
    : two

someLongCondition___________________________________
    && someLongCondition___________________________________
    ? one
    : two

someLongCondition___________________________________
    && someLongCondition___________________________________
  ? one
  : two

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect indentation in Method chain inside Initializer
2 participants