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

Better lambda indent #673

Merged
merged 6 commits into from
May 23, 2022
Merged

Better lambda indent #673

merged 6 commits into from
May 23, 2022

Conversation

belav
Copy link
Owner

@belav belav commented May 22, 2022

This handles the simple cases, #672 will take care of some more complex cases.
closes #669

return;
}
);
someObject.CallMethod(lambdaWithBlock =>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this really "better"? IMHO the previous version was more readable for both these cases.

Copy link
Owner Author

Choose a reason for hiding this comment

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

I think it is mostly better, with those examples being the ones that fall into "maybe not better" category.

These examples I think are definitely better. It saves vertical space and I don't think it is any less readable there.
belav/csharpier-repos@831f201#diff-bc2e3864cdf7b47541cca4aa46b6d378cb2c11cb0091dca0647fed8a565a7dbf

It indents less too, which helps in other cases like this
belav/csharpier-repos@831f201#diff-668431d269a33a846504a3895822785838e4d92a10e9a3ce025b37de65724ed2

fwiw, prettier formats it like this. I don't really like that they force ( ) on it

someObject.CallMethod((lambdaWithBlock) => {
    return;
});

@belav belav merged commit 20f214d into master May 23, 2022
@belav belav deleted the better-lambda-indent branch May 23, 2022 15:51
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.

Excessive indent level with lambda as the only method call argument
2 participants