Skip to content

Razor files that use HTML Tag Helpers, clicking Format Document messes up the code formatting instead of formatting it correctly #12827

@vsfeedback

Description

@vsfeedback

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


Following is the code before formatting,
Image

and following is the code after formatting.
Image

When I click Format Document in a .cshtml file that uses HTML Tag Helpers, the formatter breaks/messes up the code structure instead of formatting it correctly.

I already tried enabling “Use legacy Razor Editor for ASP.NET Core” (and also disabling it), but the issue remains the same.

My current Visual Studio settings are attached for reference.

Metadata

Metadata

Assignees

Labels

author: migration bot 🤖The issue was created by a issue mover bot. The author may not be the actual author

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions