-
Notifications
You must be signed in to change notification settings - Fork 22
LFT-1728 - Add support for CollectionExpression in async generator #963
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
Conversation
| with: | ||
| dotnet-version: | | ||
| 7.0.x | ||
| 9.0.x |
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.
Need to update for new C# 12 syntax
| SpreadElementSyntax sp => sp.WithExpression( Transform( sp.Expression ) ), | ||
| _ => UnhandledSyntax( elem ) | ||
| } ), | ||
| original.GetSeparators() |
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.
We're not passing the original separators for the other cases in the transformer, so perhaps something to correct 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.
Yeah -- see note below.
One other reason we're not doing it in the other ones is TransformAll supports the "maybe transform" e.g. so we can delete cancellation token arguments. There needs to be some accounting for that otherwise .GetSeparators() will possibly insert extra separators/commas, so it needs a bit more thought.
| original.Select( elem => elem switch { | ||
| ExpressionElementSyntax ee => ee.WithExpression( Transform( ee.Expression ) ), | ||
| SpreadElementSyntax sp => sp.WithExpression( Transform( sp.Expression ) ), | ||
| _ => UnhandledSyntax( elem ) | ||
| } ), |
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.
Particular reason this isn't just original.Select( Transform ) or something, with the top-level Dispatch handling Spread?
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.
Yeah -- what I have currently on my desktop has that, with the move to TransformAll. I'll get to it.
| _ => UnhandledSyntax( elem ) | ||
| } ), | ||
| original.GetSeparators() | ||
| ); |
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.
Actually part of this is already in place with the TransformAll combinator.
It doesn't do original.GetSeparators(), though.
I'll do a follow-up PR to switch to that, but also add the separators. That will incur some noise because we will have to fix up the whitespace in unrelated tests.
No description provided.