mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 19:42:56 +01:00
Support better C++ annotation highlighting
* Uses some simple highlighting within annotations * Supports multi-line annotations (see compiler-explorer/compiler-explorer#878)
This commit is contained in:
parent
ec67c169a8
commit
265d83f041
2 changed files with 60 additions and 1 deletions
|
|
@ -298,7 +298,7 @@ export const language = <languages.IMonarchLanguage>{
|
|||
{ include: '@whitespace' },
|
||||
|
||||
// [[ attributes ]].
|
||||
[/\[\[.*\]\]/, 'annotation'],
|
||||
[/\[\[/, { token: 'annotation', next: '@annotation' }],
|
||||
|
||||
[/^\s*#include/, { token: 'keyword.directive.include', next: '@include' }],
|
||||
|
||||
|
|
@ -384,6 +384,15 @@ export const language = <languages.IMonarchLanguage>{
|
|||
[/.*/, 'string.raw']
|
||||
],
|
||||
|
||||
annotation: [
|
||||
{ include: '@whitespace' },
|
||||
[/using|alignas/, 'keyword'],
|
||||
[/[a-zA-Z0-9_]+/, 'annotation'],
|
||||
[/[,:]/, 'delimiter'],
|
||||
[/[()]/, '@brackets'],
|
||||
[/\]\]/, { token: 'annotation', next: '@pop' }]
|
||||
],
|
||||
|
||||
include: [
|
||||
[
|
||||
/(\s*)(<)([^<>]*)(>)/,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue