Microsoft/monaco-editor

[Bug] C++ keyword highlighting for alternate spellings

Open

#3,269 创建于 2022年8月25日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)JavaScript (1,283 fork)batch import
feature-requestgrammarshelp wantedlanguages-basic

仓库指标

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

描述

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Code

// The Monaco Editor can be easily created, given an
// empty container and an options literal.
// Two members of the literal are "value" and "language".
// The editor takes the full size of its container.

monaco.editor.create(document.getElementById('container'), {
	value: "void f() { if (a and not b) { } }",
	language: 'cpp'
});

Reproduction Steps

No response

Actual (Problematic) Behavior

When viewing C++ code and using the basic highlighting the alternate spellings for keywords like and, or, etc. are not properly highlighted. The C++ standard has had these keywords since C++98 (see also [lex.key]/2).

Not having such keywords highlighted actively hurts code review.

Expected Behavior

The alternative spellings are highlighted.

Additional Context

See also src/basic-languages/cpp/cpp.ts where the spellings are missing.

贡献者指南