microsoft / microsoft/monaco-editor
[Bug] C++ keyword highlighting for alternate spellings
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 46.8k
- Forks
- 4.1k
- Avg merge
- 17h 58m
- Merged PRs (30d)
- 1
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?
- Not 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/basic-languages/cpp/cpp.ts at the keyword definitions referenced by the issue, and use the supplied Monaco playground snippet to reproduce the highlighting. Done means alternate spellings such as and and not are highlighted as C++ keywords.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100