Microsoft/monaco-editor

C++ line continuation mark (\) should be ignored everywhere

Open

#1.184 geöffnet am 14. Nov. 2018

Auf GitHub ansehen
 (4 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (1.283 Forks)batch import
feature-requestgrammarshelp wantedopen for PR

Repository-Metriken

Stars
 (14.836 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 6h 26m) (15 gemergte PRs in 30 T)

Beschreibung

monaco-editor version: 0.15.1 Browser: Chrome (maybe others) OS: Windows

In C/C++ \ is used as line continuation mark so defining macros in multi-line is possible:

#define MACRO do { \
} while(false);

It is also possible to change a single line comment to multi-line with \:

// Multi \
   Line \
   Comment

As you see in above snippet, Github syntax highlighter accept this syntax in comments and colorize line 2 and 3 as comments, but Monaco does not:

image

This is somehow strange that the VSCode highlights it correctly but Monaco does not. image

Contributor Guide