diff --git a/src/lib/components/editor/util.ts b/src/lib/components/editor/util.ts index eb85b3a2..6ee8b14e 100644 --- a/src/lib/components/editor/util.ts +++ b/src/lib/components/editor/util.ts @@ -21,13 +21,15 @@ export const initEditor = (monacoEditor): void => { 'info' ], keywords: ['participant', 'as', 'showInfo', 'autonumber'], + orientation: ['TB', 'TD', 'BT', 'RL', 'LR'], arrows: ['---', '===', '-->>', '-->', '==>', '->>', '->', '--)', '-)', '--x', '-x'].reduce( (accumalator, arrow) => accumalator.concat(arrow, arrow + '+', arrow + '-'), [] ), tokenizer: { root: [ - [/[a-z_$][\w$]*/, { cases: { '@typeKeywords': 'keyword', '@keywords': 'keyword' } }], + [/[a-z_$][\w$]*/, { cases: { '@typeKeywords': 'typeKeyword', '@keywords': 'keyword' } }], + [/[A-Z$][\w$]*/, { cases: { '@orientation': 'keyword' } }], [/[[{(}>]+.+?[)\]}]+/, 'string'], [/[-+=>ox]+/, { cases: { '@arrows': 'transition' } }], [/[{}]/, 'delimiter.bracket'], @@ -45,7 +47,8 @@ export const initEditor = (monacoEditor): void => { base: 'vs', inherit: false, rules: [ - { token: 'keyword', foreground: '880000', fontStyle: 'bold' }, + { token: 'typeKeyword', foreground: '880000', fontStyle: 'bold' }, + { token: 'keyword', foreground: '880000' }, { token: 'custom-error', foreground: 'ff0000', fontStyle: 'bold' }, { token: 'string', foreground: 'AA8500' }, { token: 'transition', foreground: '008800', fontStyle: 'bold' },