feat: support sankey diagram highlighting

This commit is contained in:
Reda Al Sulais
2023-09-16 15:02:06 +03:00
parent e504f25680
commit d0dcbf37e1
+16
View File
@@ -204,6 +204,11 @@ export const initEditor = (monacoEditor: typeof Monaco): void => {
'Rel_Back',
'RelIndex'
]
},
sankey: {
typeKeywords: ['sankey-beta'],
blockKeywords: [],
keywords: []
}
};
@@ -248,6 +253,7 @@ export const initEditor = (monacoEditor: typeof Monaco): void => {
[/^\s*stateDiagram(-v2)?/, 'typeKeyword', 'stateDiagram'],
[/^\s*er(Diagram)?/, 'typeKeyword', 'erDiagram'],
[/^\s*requirement(Diagram)?/, 'typeKeyword', 'requirementDiagram'],
[/^\s*sankey-beta/m, 'typeKeyword', 'sankey'],
[
/^\s*(C4Context|C4Container|C4Component|C4Dynamic|C4Deployment)/m,
'typeKeyword',
@@ -535,6 +541,16 @@ export const initEditor = (monacoEditor: typeof Monaco): void => {
[/,/, 'delimiter.bracket'],
[/\)/, { next: '@pop', token: 'delimiter.bracket' }],
[/[^),]/, 'string']
],
sankey: [
configDirectiveHandler,
[/(title)(.*)/, ['keyword', 'string']],
[/(accTitle|accDescr)(\s*:)(\s*[^\n\r]+$)/, ['keyword', 'delimiter.bracket', 'string']],
[/".*?"/, 'string'],
[/[A-Za-z]+/, 'string'],
[/\s*\d+/, 'number'],
[/,/, 'delimiter.bracket'],
[/%%[^$]([^%]*(?!%%$)%?)*$/, 'comment']
]
}
});