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

Exclude switch arms from brace placement options #57854

Closed
sharwell opened this issue Nov 18, 2021 · 3 comments · Fixed by #70014
Closed

Exclude switch arms from brace placement options #57854

sharwell opened this issue Nov 18, 2021 · 3 comments · Fixed by #70014
Assignees
Labels
Area-IDE Concept-Continuous Improvement help wanted The issue is "up for grabs" - add a comment if you are interested in working on it IDE-Formatter Code formatter and/or smart indent Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Milestone

Comments

@sharwell
Copy link
Member

Related to #57736 (comment) and #39557.

The { of a pattern should not be moved to the preceding line by the formatter in the following case:

  1. The { is the first token of a switch arm
  2. The { is the first token on the line where it appears
  3. The containing switch expression already spans multiple lines
@sharwell sharwell added help wanted The issue is "up for grabs" - add a comment if you are interested in working on it Area-IDE Concept-Continuous Improvement IDE-Formatter Code formatter and/or smart indent labels Nov 18, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Nov 18, 2021
@maloo
Copy link

maloo commented Nov 18, 2021

Can this be included in a patch release of .NET 6 SDK since this is was a breaking change (bug?) from .NET5? Many CI systems use dotnet format, and they are all broken now using .NET 6 SDK. Previously it was a separate tool and easier to select specific version.

@maloo
Copy link

maloo commented Nov 18, 2021

"all broken", those that use { on previous line

@jinujoseph jinujoseph removed the untriaged Issues and PRs which have not yet been triaged by a lead label Dec 1, 2021
@jinujoseph jinujoseph modified the milestones: 17.1, Backlog Dec 1, 2021
sharwell added a commit to sharwell/roslyn that referenced this issue Dec 8, 2021
@jinujoseph jinujoseph modified the milestones: 17.1, 17.3 Apr 27, 2022
@arunchndr arunchndr modified the milestones: 17.3, 17.6 P2 Jan 17, 2023
@maloo
Copy link

maloo commented Sep 6, 2023

@sharwell Any reason this is still not merged? We keep trying to enable dotnet format every release and it would be nice to get it for dotnet 8 at least. This has been broken since dotnet 6 release...

sharwell added a commit to sharwell/roslyn that referenced this issue Sep 19, 2023
@sharwell sharwell added the Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented label Dec 27, 2023
@sharwell sharwell modified the milestones: 17.6 P2, Next Dec 27, 2023
@Cosifne Cosifne modified the milestones: Next, 17.9 P3 Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Concept-Continuous Improvement help wanted The issue is "up for grabs" - add a comment if you are interested in working on it IDE-Formatter Code formatter and/or smart indent Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants