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

Preserve formatting when converting array-expressions to collection-expressions. #69278

Merged
merged 4 commits into from
Jul 31, 2023

Conversation

CyrusNajmabadi
Copy link
Member

@CyrusNajmabadi CyrusNajmabadi commented Jul 28, 2023

This is work so that the collection-expression we produce is as close as possible to the user's original code as possible. Importantly, a major tenet of this is that we want the [ ] braces of the collection expression to correspond to where the { } braces were in the original expression if present.

This PR is just for array expressions: { ... }, new T[] { ... }, new[] { ... }.

This will also apply in future PRs that deal with converting collection initializers new X() { ... } to collection expressions.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner July 28, 2023 19:38
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 28, 2023
@CyrusNajmabadi
Copy link
Member Author

@genlu @Cosifne ptal. :)

@CyrusNajmabadi CyrusNajmabadi merged commit 169b22f into dotnet:main Jul 31, 2023
@CyrusNajmabadi CyrusNajmabadi deleted the useCollectionExpression5 branch July 31, 2023 16:16
@ghost ghost added this to the Next milestone Jul 31, 2023
@dibarbet dibarbet modified the milestones: Next, 17.8 P2 Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants