Microsoft/monaco-editor

Wrong YAML syntax highlighting

Open

#2,681 创建于 2021年10月4日

在 GitHub 查看
 (1 评论) (1 反应) (0 负责人)JavaScript (1,283 fork)batch import
buggrammarshelp wanted

仓库指标

Star
 (14,836 star)
PR 合并指标
 (平均合并 6小时 26分钟) (30 天内合并 15 个 PR)

描述

There seem to be some wrong syntax highlighting when for example entering foo: "{bar: 7}". Monaco highlights {bar the same way as foo. It should better respect that it is part of a string value. Just tested the same with VS Code and it doesn't have this problem.

monaco-editor version: 0.28.0 Browser: tested in Chrome OS: Windows 10 Playground code that reproduces the issue:

monaco.editor.create(document.getElementById("container"), {
    value: 'foo: "{bar: 7}"\n',
    language: 'yaml'
});

贡献者指南