Microsoft/monaco-editor

[Bug] C++ keyword highlighting for alternate spellings

Open

#3,269 opened on Aug 25, 2022

View on GitHub
 (1 comment) (0 reactions) (0 assignees)JavaScript (1,283 forks)batch import
feature-requestgrammarshelp wantedlanguages-basic

Repository metrics

Stars
 (14,836 stars)
PR merge metrics
 (Avg merge 6h 26m) (15 merged PRs in 30d)

Description

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.

Contributor guide