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

VisualStudio command Edit.FormatDocument breaks the indention #1724

Closed
mynkow opened this Issue Nov 25, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@mynkow

mynkow commented Nov 25, 2018

When I am in VS and execute the command Edit.FormatDocument (CTRL+E,D) this happens= >

https://gyazo.com/209c7bc8d065dcd7eef421f780e2682f

@Andrzej-W

This comment has been minimized.

Andrzej-W commented Nov 25, 2018

It is annoying, but there is simple workaround: remove space between @functions and {. Unfortunately the correct formatting is that after Ctrl+E,D with space before { or with { in a new line. We are writing C# code and it should be formatted like this:

@functions
{
    bool collapseNavMenu = true;
    void ToggleNavMenu()
    {
        collapseNavMenu = !collapseNavMenu;
    }
}
@SteveSandersonMS

This comment has been minimized.

Member

SteveSandersonMS commented Nov 26, 2018

Sorry for the inconvenience. We're aware of many cases where .cshtml formatting goes wrong and are working on making this more robust.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment