Why doesn't Visual Studio code formatting work properly for Razor markup?

后端 未结 10 1615
醉梦人生
醉梦人生 2020-12-08 13:04

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

10条回答
  •  眼角桃花
    2020-12-08 13:25

    Right now I'm on VS2013 ASP.NET MVC 5 and I still have that problem. What I found to be a lot helpful is to put the first expression on the same line where the opening block symbol is (@{). That way razor code formatting produces a far better result. Here are the before and after cases:

    BEFORE

    AFTER

提交回复
热议问题