Microsoft/monaco-editor

[Bug] C++ keyword highlighting for alternate spellings

Open

#3 269 ouverte le 25 août 2022

Voir sur GitHub
 (1 commentaire) (0 réactions) (0 assignés)JavaScript (1 283 forks)batch import
feature-requestgrammarshelp wantedlanguages-basic

Métriques du dépôt

Stars
 (14 836 stars)
Métriques de merge PR
 (Merge moyen 6h 26m) (15 PRs mergées en 30 j)

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.

Guide contributeur