Non-bold non-type-keywords and orientations
This commit is contained in:
@@ -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' },
|
||||
|
||||
Reference in New Issue
Block a user