Indentation is broken in Visual Studio .cshtml files

后端 未结 3 429
北恋
北恋 2021-01-17 12:12

It\'s the most infuriating thing and after 45 minutes of Googling and testing I caved to the forum gods... I simply cannot live without automatic indentation, even if it\'s

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-17 12:48

    You mentioned that you just installed Resharper before this problem started occurring, so your problem is most likely being caused by Resharper.

    By default Resharper does many extra formatting fixes as you type, but you'll likely find a bunch of these default fixes conflict with your coding style.

    You can configure Resharper's code formatting options via Resharper > Options > Code Editing > HTML|Razor|etc > Formatting Style

    In this case, your problem was the setting Do not indent children of contained tags that you didn't want by default.

提交回复
热议问题