Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

VSCode wreaking havoc on Blazor razor file formatting

$
0
0

Does anyone have a suggestion regarding the formatting behavior seen in the screen shots below? It's happening only on .razor files inside a Blazor project. Formatting of cshtml files seems to be working.

The samples are simple. Much larger files are a mess after formatting.

VsCode v1.90.2 (Universal) // C# Dev Kit v1.7.27 // .NET 8.0.302 // Mac OS Sonoma v14.5

REMOVED IMAGES AND REPLACED WITH CODE SAMPLES

@*BEFORE USING FORMAT DOCUMENT COMMAND*@@page "/rotation"@if (loading){<h3>Loading...</h3>}else{    if (showError)    {<div class="row alert alert-warning"><p>@errorMessage</p></div>    }<div class="row align-items-start"><div class="col"><p>One of three columns</p></div><div class="col"><p>One of three columns</p></div><div class="col"><p>One of three columns</p></div></div>}

@*AFTER USING DOCUMENT FORMAT COMMAND*@@page "/rotation"@if (loading){<h3>Loading...</h3>}else{    if (showError)    {<div class="row alert alert-warning"><p>@errorMessage</p></div>    }<div class="row align-items-start"><div class="col"><p>One of three columns</p></div><div class="col"><p>One of three columns</p></div><div class="col"><p>One of three columns</p></div></div>}

Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>