From 85b031cbe10b88fd9909b87ad5332b044c263fd6 Mon Sep 17 00:00:00 2001 From: Robert Hebel Date: Thu, 22 Jan 2026 15:54:05 +0100 Subject: [PATCH] feat(async3): add full syntax highlighting support for async3 --- .../editor-monaco/themes/se-vs-dark.js | 25 ++++++++++++++++++- .../editor-monaco/themes/se-vs-light.js | 25 ++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/src/plugins/editor-monaco/themes/se-vs-dark.js b/src/plugins/editor-monaco/themes/se-vs-dark.js index 29d8db82ca8..e0cda4918b3 100644 --- a/src/plugins/editor-monaco/themes/se-vs-dark.js +++ b/src/plugins/editor-monaco/themes/se-vs-dark.js @@ -117,13 +117,22 @@ export default { { token: 'externalDocumentation', foreground: '#d0d0e3', fontStyle: 'bold' }, // additional top-level tokens for AsyncAPI Object: bold, with light purple-white { token: 'spec-version', foreground: '#d0d0e3', fontStyle: 'bold' }, // e.g. asyncapi + { token: 'defaultContentType', foreground: '#d0d0e3', fontStyle: 'bold' }, { token: 'channels', foreground: '#d0d0e3', fontStyle: 'bold' }, + { token: 'operations', foreground: '#d0d0e3', fontStyle: 'bold' }, // messages tokens: purple { token: 'components-messages', foreground: '#C678DD', fontStyle: 'bold' }, + { token: 'components-messageTraits', foreground: '#C678DD', fontStyle: 'bold' }, { token: 'messages', foreground: '#C678DD', fontStyle: 'italic' }, { token: 'message', foreground: '#C678DD' }, + { token: 'messageTraits', foreground: '#C678DD', fontStyle: 'italic' }, + { token: 'messageExample', foreground: '#C678DD' }, // operation tokens: swagger-ui-post=green, swagger-ui-get=blue + { token: 'components-operations', foreground: '#66afce', fontStyle: 'bold' }, + { token: 'components-operationTraits', foreground: '#66afce', fontStyle: 'bold' }, { token: 'operation', foreground: '#66afce', fontStyle: 'bold' }, // light blue + { token: 'operationTraits', foreground: '#66afce', fontStyle: 'italic' }, + { token: 'operationBindings', foreground: '#66afce' }, { token: 'operation.httpMethod-GET', foreground: '#0099ff', fontStyle: 'bold' }, // blue { token: 'operation.httpMethod-POST', foreground: '#00cc99', fontStyle: 'bold' }, // teal // parameters tokens: purple @@ -136,9 +145,12 @@ export default { // components/{schemas}/schema: bold olive green { token: 'components-schemas', foreground: '#ceca84', fontStyle: 'bold' }, { token: 'schema', foreground: '#ceca84', fontStyle: 'bold' }, - // pathItem & channelItem: bold olive green + { token: 'multiFormatSchema', foreground: '#ceca84', fontStyle: 'bold' }, + // pathItem, channel & channelItem: bold olive green { token: 'pathItem', foreground: '#ceca84', fontStyle: 'bold' }, { token: 'channelItem', foreground: '#ceca84', fontStyle: 'bold' }, + { token: 'channel', foreground: '#ceca84', fontStyle: 'bold' }, + { token: 'components-channels', foreground: '#ceca84', fontStyle: 'bold' }, // request & response: olive green { token: 'requestBody', foreground: '#ceca84', fontStyle: 'italic' }, { token: 'responses', foreground: '#ceca84', fontStyle: 'italic' }, @@ -156,6 +168,11 @@ export default { { token: 'components-callbacks', foreground: '#ceca84', fontStyle: 'bold' }, { token: 'components-pathItems', foreground: '#ceca84', fontStyle: 'bold' }, { token: 'components-path-items', foreground: '#ceca84', fontStyle: 'bold' }, + // AsyncAPI 3 specific components: bold olive green + { token: 'components-replies', foreground: '#ceca84', fontStyle: 'bold' }, + { token: 'components-reply-addresses', foreground: '#ceca84', fontStyle: 'bold' }, + { token: 'components-tags', foreground: '#ceca84', fontStyle: 'bold' }, + { token: 'components-external-documentation', foreground: '#ceca84', fontStyle: 'bold' }, // plain value: green { token: 'value', foreground: '#98C379' }, { token: 'value.string', foreground: '#98C379' }, @@ -179,9 +196,15 @@ export default { { token: 'operation-example', foreground: '#1de2fa' }, { token: 'operation-callbacks', foreground: '#1de2fa' }, { token: 'securityScheme', foreground: '#1de2fa' }, + { token: 'securityRequirement', foreground: '#1de2fa' }, { token: 'server-variables', foreground: '#1de2fa' }, { token: 'messageTrait', foreground: '#1de2fa' }, { token: 'operationTrait', foreground: '#1de2fa' }, + // bindings: sky blue + { token: 'channel-binding', foreground: '#1de2fa' }, + // AsyncAPI 3 specific: sky blue + { token: 'operationReply', foreground: '#1de2fa' }, + { token: 'operationReplyAddress', foreground: '#1de2fa' }, // tokens exist in apidom-ls, but not working in editor, sky blue { token: 'version', foreground: '#1de2fa' }, { token: 'title', foreground: '#1de2fa' }, diff --git a/src/plugins/editor-monaco/themes/se-vs-light.js b/src/plugins/editor-monaco/themes/se-vs-light.js index 125a006d133..07fc37b3849 100644 --- a/src/plugins/editor-monaco/themes/se-vs-light.js +++ b/src/plugins/editor-monaco/themes/se-vs-light.js @@ -117,13 +117,22 @@ export default { { token: 'externalDocumentation', foreground: '#000033', fontStyle: 'bold' }, // additional top-level tokens for AsyncAPI Object: bold dark grey with purple tint { token: 'spec-version', foreground: '#000033', fontStyle: 'bold' }, // e.g. asyncapi + { token: 'defaultContentType', foreground: '#000033', fontStyle: 'bold' }, { token: 'channels', foreground: '#000033', fontStyle: 'bold' }, + { token: 'operations', foreground: '#000033', fontStyle: 'bold' }, // messages tokens: purple { token: 'components-messages', foreground: '#993399', fontStyle: 'bold' }, + { token: 'components-messageTraits', foreground: '#993399', fontStyle: 'bold' }, { token: 'messages', foreground: '#993399', fontStyle: 'italic' }, { token: 'message', foreground: '#993399' }, + { token: 'messageTraits', foreground: '#993399', fontStyle: 'italic' }, + { token: 'messageExample', foreground: '#993399' }, // operation tokens: swagger-ui-post=green, swagger-ui-get=blue + { token: 'components-operations', foreground: '#66afce', fontStyle: 'bold' }, + { token: 'components-operationTraits', foreground: '#66afce', fontStyle: 'bold' }, { token: 'operation', foreground: '#66afce', fontStyle: 'bold' }, // light blue + { token: 'operationTraits', foreground: '#66afce', fontStyle: 'italic' }, + { token: 'operationBindings', foreground: '#66afce' }, { token: 'operation.httpMethod-GET', foreground: '#006699', fontStyle: 'bold' }, // blue-grey { token: 'operation.httpMethod-POST', foreground: '#339966', fontStyle: 'bold' }, // dark teal // parameters tokens: purple @@ -136,9 +145,12 @@ export default { // components/{schemas}/schema: bold olive green { token: 'components-schemas', foreground: '#666633', fontStyle: 'bold' }, { token: 'schema', foreground: '#666633', fontStyle: 'bold' }, - // pathItem & channelItem: bold olive green + { token: 'multiFormatSchema', foreground: '#666633', fontStyle: 'bold' }, + // pathItem, channel & channelItem: bold olive green { token: 'pathItem', foreground: '#666633', fontStyle: 'bold' }, { token: 'channelItem', foreground: '#666633', fontStyle: 'bold' }, + { token: 'channel', foreground: '#666633', fontStyle: 'bold' }, + { token: 'components-channels', foreground: '#666633', fontStyle: 'bold' }, // request & response: olive green { token: 'requestBody', foreground: '#666633', fontStyle: 'italic' }, { token: 'responses', foreground: '#666633', fontStyle: 'italic' }, @@ -156,6 +168,11 @@ export default { { token: 'components-callbacks', foreground: '#666633', fontStyle: 'bold' }, { token: 'components-pathItems', foreground: '#666633', fontStyle: 'bold' }, { token: 'components-path-items', foreground: '#666633', fontStyle: 'bold' }, + // AsyncAPI 3 specific components: bold olive green + { token: 'components-replies', foreground: '#666633', fontStyle: 'bold' }, + { token: 'components-replyAddresses', foreground: '#666633', fontStyle: 'bold' }, + { token: 'components-tags', foreground: '#666633', fontStyle: 'bold' }, + { token: 'components-externalDocs', foreground: '#666633', fontStyle: 'bold' }, // plain value: green { token: 'value', foreground: '#339933' }, { token: 'value.string', foreground: '#339933' }, @@ -179,9 +196,15 @@ export default { { token: 'operation-example', foreground: '#0099cc' }, { token: 'operation-callbacks', foreground: '#0099cc' }, { token: 'securityScheme', foreground: '#0099cc' }, + { token: 'securityRequirement', foreground: '#0099cc' }, { token: 'server-variables', foreground: '#0099cc' }, { token: 'messageTrait', foreground: '#0099cc' }, { token: 'operationTrait', foreground: '#0099cc' }, + // bindings: sky blue + { token: 'channel-binding', foreground: '#0099cc' }, + // AsyncAPI 3 specific: sky blue + { token: 'operationReply', foreground: '#0099cc' }, + { token: 'operationReplyAddress', foreground: '#0099cc' }, // tokens exist in apidom-ls, but not working in editor, sky blue { token: 'version', foreground: '#0099cc' }, { token: 'title', foreground: '#0099cc' },