The VS2019 syntax highlighting seems to be going berzerk when confronted with a local function in an ASP.NET Core 3.1 Razor view. A function like this:
@{
void Buttons()
{
<div class="col-md-12">
<button type="submit" name="Command" value="close">Save & Close</button>
<button type="submit" name="Command" value="save">Save & Stay</button>
<button type="submit" name="Command" value="cancel">Cancel</button>
</div>
}
}
shows up highlighted as full of errors, when in fact it compiles and works just fine. Hovering the mouse pointer over the <div>
pops up Cannot resolve symbol <div>.
message.
Has anybody found a workaround, or do we need to wait for VS highlighting to catch up with the new syntax?