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

Incorrect switch indentation when using indented braces #46464

Open
vsfeedback opened this issue Jul 30, 2020 · 0 comments
Open

Incorrect switch indentation when using indented braces #46464

vsfeedback opened this issue Jul 30, 2020 · 0 comments
Labels
Area-IDE Bug Developer Community The issue was originally reported on https://developercommunity.visualstudio.com 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
Milestone

Comments

@vsfeedback
Copy link

vsfeedback commented Jul 30, 2020

This issue has been moved from a ticket on Developer Community.


[severity:I'm somewhat annoyed. A fix would be nice]
When Visual Studio is configured to indent braces it incorrectly indents content of a switch statement. Attached solution with a sample for reproduction. Open Program.cs and and use Ctrl+K, Ctrl+D shortcut to format code.

Expected result:

var value = key switch
    {
    "a" => "b",
    "b" => "c",
    "c" => "d",
    _ => ""
    };

Actual result:

var value = key switch
    {
        "a" => "b",
        "b" => "c",
        "c" => "d",
        _ => ""
        };

Original Comments

Feedback Bot on 7/30/2020, 00:38 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Feedback Bot on 7/30/2020, 04:08 PM:

This issue is currently being investigated. Our team will get back to you if either more information is needed, a workaround is available, or the issue is resolved.


Original Solutions

(no solutions)

@sharwell sharwell added Area-IDE Bug 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 labels Jul 30, 2020
@sharwell sharwell added this to the Backlog milestone Jul 30, 2020
@sharwell sharwell added the Developer Community The issue was originally reported on https://developercommunity.visualstudio.com label Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Bug Developer Community The issue was originally reported on https://developercommunity.visualstudio.com 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
Projects
None yet
Development

No branches or pull requests

2 participants