Microsoft/monaco-editor

Razor syntax highlighting does not recognize @code or @functions

Open

#1 997 ouverte le 3 juin 2020

Voir sur GitHub
 (3 commentaires) (0 réactions) (0 assignés)JavaScript (1 283 forks)batch import
buggrammarshelp wanted

Métriques du dépôt

Stars
 (14 836 stars)
Métriques de merge PR
 (Merge moyen 6h 26m) (15 PRs mergées en 30 j)

Description

monaco-editor version: 0.2.0 Browser: Tested on Chromium and Firefox OS: Ubuntu 19.10

When the language is set to razor, @code or @functions is not recognized and shows up (along with all the C# code inside of it) in the default text color. This can be reproduced by going to the Monaco Editor homepage, setting the language to razor, and entering this code:

@{
    @* This C# code will have syntax highlighting *@
    var test = "testing";
    if (true)
    {
        Console.WriteLine("testing");
    }
}
@code {
    @* This C# code will not have syntax highlighting *@
    var test = "testing";
    if (true)
    {
        Console.WriteLine("testing");
    }
}
@functions {
    @* This C# code will also not have syntax highlighting *@
    var test = "testing";
    if (true)
    {
        Console.WriteLine("testing");
    }
}

Guide contributeur