Open Sickeroni opened 1 year ago
The code to use in the playground would be:
monaco.editor.create(document.getElementById('container'), {
value: "[[nodiscard(\"is the word using highlighted? Yes it is\")]]\nint test() {\n return 42;\n}",
language: 'cpp'
});
This reproduces this situation.
Updated the playground part thanks to to https://github.com/partouf
This looks fairly trivial, maybe as simple as adding a line that matches strings before https://github.com/microsoft/monaco-editor/blob/main/src/basic-languages/cpp/cpp.ts#L400, such as [/(")([^"]*)(")/, 'string'],
.
Reproducible in vscode.dev or in VS Code Desktop?
Reproducible in the monaco editor playground?
Monaco Editor Playground Code
[edit]
[/edit]
Reproduction Steps
or the extended
or just use this link https://godbolt.org/z/4cc31Wf4Y
Actual (Problematic) Behavior
Syntax highlighting is wrong when using specific keywords in string literals in attribute specifiers. Found only the word "using" but properly there are more. [edit]same for alignas[/edit]
The following (key)words don't have the problem:
just see the color of the word "using"
same for the extended code
the other (key)words:
and for completion here the vscode version
Expected Behavior
Since it is a string literal, it should be the same color as other parts of the text.
Additional Context
When using godbolt, this bug appeared. The issue based on it is to be found at https://github.com/compiler-explorer/compiler-explorer/issues/4239
The suggestion was to create a issue here, since their syntax highlighting is monaco based.
relevant quotes: