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

mynkow opened this Issue Nov 25, 2018 · 2 comments


None yet
3 participants

mynkow commented Nov 25, 2018

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


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:

    bool collapseNavMenu = true;
    void ToggleNavMenu()
        collapseNavMenu = !collapseNavMenu;

This comment has been minimized.


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