Bug: VS 2022 cshtml file breaks javascript formatting
This issue has been moved from a ticket on Developer Community.
[severity:It’s more difficult to complete my work] [regression] [worked-in:VS 2019]
Javascript usually has nicely coloured fonts for reserved words and strings. But if the html code above the js has an html style comment starting with <!-- inside a cs block (which starts with the @ symbol) then the formatting is lost.
<!-- This comment is fine -->
@if (1 == 1)
{
// This comment works fine here
<!-- But this one breaks the javascript highlighting below just by existing inside the if loop -->
<h3 class="page-title" id="PageTitle"><b><u>Blah blah</u></b></h3>
}
<script>
var loading = true;
// blah
</script>
Original Comments
Feedback Bot on 8/28/2023, 06:30 PM:
(private comment, text removed)
Feedback Bot on 9/5/2023, 03:32 AM:
(private comment, text removed)
Original Solutions
(no solutions)
@davidwengier @333fred Is this likely to be a parsing issue? That the compiler is incorrectly reporting the tree and the tooling is thus doing the wrong thing?
This would most likrly be a TextMate grammar issue, not compiler.
VS Code also has this issue too.