Microsoft/monaco-editor

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

開放

#1,184 建立於 2018年11月14日

 (4 則留言) (0 個反應) (0 位負責人)JavaScript (4,064 個分叉)batch import
feature-requestgrammarshelp wantedopen for PR

倉庫指標

星標
 (46,002 顆星)
PR 合併指標
 (平均合併 6小時 26分鐘) (30 天內合併 15 個 PR)

描述

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

貢獻者指南