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

#endregion directive improperly indented when followed by a label #75919

Open
jcouv opened this issue Nov 14, 2024 · 0 comments
Open

#endregion directive improperly indented when followed by a label #75919

jcouv opened this issue Nov 14, 2024 · 0 comments
Labels
Area-IDE IDE-Formatter Code formatter and/or smart indent
Milestone

Comments

@jcouv
Copy link
Member

jcouv commented Nov 14, 2024

In the following code, the #endregion is indented incorrectly by the formatter. The #endregion should be indented to the same level as the #region. But instead, it gets formatted to the same level as the label that follows it.

class C
{
    void M()
    {
        int i = 0;

        #region region one
        if (i == 0)
        {
            goto label0;
        }
        else if (i == 1)
        {
            goto label1;
        }
    #endregion // Expected: this should align with the #region above

    label0:
        return;
    label1:
        return;
    }
}

Image

@jcouv jcouv added the Area-IDE label Nov 14, 2024
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Nov 14, 2024
@CyrusNajmabadi CyrusNajmabadi added IDE-Formatter Code formatter and/or smart indent and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Nov 14, 2024
@CyrusNajmabadi CyrusNajmabadi added this to the Backlog milestone Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE IDE-Formatter Code formatter and/or smart indent
Projects
None yet
Development

No branches or pull requests

2 participants