Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# comments in HTML text node in switch case statement classifies further HTML text and C# identifiers as C# comments #11249

Open
Peter-Juhasz opened this issue Nov 23, 2024 · 1 comment

Comments

@Peter-Juhasz
Copy link

VS 17.13.0 P1
.NET 9.0.100

20241123-2007-28.8991940.mp4

Minimal repro, having a simple URL:

Image

@switch (true)
{
    case true:
    {
        <p>this is a text https://example.org<h3>Test</h3></p>
    }
        break;
}

And then look at this with a multi-line comment, this is just ridiculous:

Image

@switch (true)
{
    case true:
    {
        <p>this is a text https:/*example.org<h3>Test</h3></p>
    }
        break;
}

@code {
    private int Something = 0;
}

(Obviously GitHub's syntax highlighter is utterly broken, since it is based on silly regex instead of a proper parser, so it won't display properly. I can only hope based on this phenomenon it is not the case for Razor...)

@phil-allen-msft
Copy link
Contributor

This may be from syntactic coloring or semantic coloring; if it turns out to be semantic coloring, it may be an issue on the compiler side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants