Microsoft/monaco-editor

Razor syntax highlighting does not recognize @code or @functions

开放

#1,997 创建于 2020年6月3日

 (3 条评论) (0 个反应) (0 位负责人)JavaScript (4,064 个派生)batch import
buggrammarshelp wanted

仓库指标

星标
 (46,002 个星标)
PR 合并指标
 (平均合并 6小时 26分钟) (30 天内合并 15 个 PR)

描述

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");
    }
}

贡献者指南