Microsoft/monaco-editor

[Bug] C++ keyword highlighting for alternate spellings

Open

#3269 aperta il 25 ago 2022

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)JavaScript (1283 fork)batch import
feature-requestgrammarshelp wantedlanguages-basic

Metriche repository

Star
 (14.836 star)
Metriche merge PR
 (Merge medio 6h 26m) (15 PR mergiate in 30 g)

Descrizione

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.

Guida contributor