Or, should I rather ask, when will VS code formatting work properly for Razor markup? The formatting works for most structures, but it seems to choke on \'if\' blocks. The c
I found one "solution" that allows you to continue using tab indentation and have correct formatting. It's more of a pattern. The key is to use razor code blocks instead of inline code.
So for example, replace the following:
@if (true)
{
Hi
}
with:
@{
if (true)
{
Hi
}
}
The latter will format correctly, but the former won't.
Keep in mind, the formatting isn't perfect, but it's better than before.