Non-bold non-type-keywords and orientations

This commit is contained in:
Yash-Singh1
2021-08-17 17:36:45 -07:00
parent ae2880c8a2
commit ff48d906ae
+5 -2
View File
@@ -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' },