-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
feat: Improve formatting of lambda expressions #1066
Conversation
Examples from #672#672 (comment)
#672 (comment)
#672 (comment)I think, it can be better
|
Example from #766
|
Examples from #836#836 (comment)
#836 (comment)
|
Example from #451
|
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.
Thanks for the PR. The code looks mostly good, but I do have a minor reservation about the new formatting.
Please let me know what you think about the case I commented on.
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MemberChain_PropertiesConsistent.test
Show resolved
Hide resolved
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/VariableDeclarations.test
Show resolved
Hide resolved
@Rudomitori Thank you! 🧡 |
What happened to this? I don't see the merge commit on |
@belav, is there something wrong with this PR? I have free time these days, and can try to fix it, or at least discuss it |
Not at all, sorry I should have said something here and not just on discord. I pulled it out of main a couple of times now to release a 0.26.X version, I am trying to stick to only bug fix types changes until 0.27.0 I'll have it back in main shortly. |
# Conflicts: # Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MemberChains.test
@Rudomitori I also ran this change against a repo full of test code, and it looks there is one bug it introduces, otherwise I agree that this is a great improvement! private static readonly ModelBinderProviderCollection _providers =
CreateDefaultCollection();
// formats as
private static readonly ModelBinderProviderCollection _providers = CreateDefaultCollection(
); From https://github.com/belav/csharpier-repos/pull/96/files, there appear to be a few variations of this extra blank line, but they are probably all the same issue. |
I've created an issue for the bugs introduced by this PR |
* fix: Bug with empty argument list * fix: Incorrect formatting of lambdas with nested lambdas Group id used in ArgumentListLikeSyntax was not unique and the nested lambda overrode the state of the parent lambda * style: Use switch expression instead of statement * fix: Second bug in 1077 Closes #1077
#766
#836
#672