Skip to content

Commit 85b031c

Browse files
feat(async3): add full syntax highlighting support for async3
1 parent c23b693 commit 85b031c

File tree

2 files changed

+48
-2
lines changed

2 files changed

+48
-2
lines changed

src/plugins/editor-monaco/themes/se-vs-dark.js

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,22 @@ export default {
117117
{ token: 'externalDocumentation', foreground: '#d0d0e3', fontStyle: 'bold' },
118118
// additional top-level tokens for AsyncAPI Object: bold, with light purple-white
119119
{ token: 'spec-version', foreground: '#d0d0e3', fontStyle: 'bold' }, // e.g. asyncapi
120+
{ token: 'defaultContentType', foreground: '#d0d0e3', fontStyle: 'bold' },
120121
{ token: 'channels', foreground: '#d0d0e3', fontStyle: 'bold' },
122+
{ token: 'operations', foreground: '#d0d0e3', fontStyle: 'bold' },
121123
// messages tokens: purple
122124
{ token: 'components-messages', foreground: '#C678DD', fontStyle: 'bold' },
125+
{ token: 'components-messageTraits', foreground: '#C678DD', fontStyle: 'bold' },
123126
{ token: 'messages', foreground: '#C678DD', fontStyle: 'italic' },
124127
{ token: 'message', foreground: '#C678DD' },
128+
{ token: 'messageTraits', foreground: '#C678DD', fontStyle: 'italic' },
129+
{ token: 'messageExample', foreground: '#C678DD' },
125130
// operation tokens: swagger-ui-post=green, swagger-ui-get=blue
131+
{ token: 'components-operations', foreground: '#66afce', fontStyle: 'bold' },
132+
{ token: 'components-operationTraits', foreground: '#66afce', fontStyle: 'bold' },
126133
{ token: 'operation', foreground: '#66afce', fontStyle: 'bold' }, // light blue
134+
{ token: 'operationTraits', foreground: '#66afce', fontStyle: 'italic' },
135+
{ token: 'operationBindings', foreground: '#66afce' },
127136
{ token: 'operation.httpMethod-GET', foreground: '#0099ff', fontStyle: 'bold' }, // blue
128137
{ token: 'operation.httpMethod-POST', foreground: '#00cc99', fontStyle: 'bold' }, // teal
129138
// parameters tokens: purple
@@ -136,9 +145,12 @@ export default {
136145
// components/{schemas}/schema: bold olive green
137146
{ token: 'components-schemas', foreground: '#ceca84', fontStyle: 'bold' },
138147
{ token: 'schema', foreground: '#ceca84', fontStyle: 'bold' },
139-
// pathItem & channelItem: bold olive green
148+
{ token: 'multiFormatSchema', foreground: '#ceca84', fontStyle: 'bold' },
149+
// pathItem, channel & channelItem: bold olive green
140150
{ token: 'pathItem', foreground: '#ceca84', fontStyle: 'bold' },
141151
{ token: 'channelItem', foreground: '#ceca84', fontStyle: 'bold' },
152+
{ token: 'channel', foreground: '#ceca84', fontStyle: 'bold' },
153+
{ token: 'components-channels', foreground: '#ceca84', fontStyle: 'bold' },
142154
// request & response: olive green
143155
{ token: 'requestBody', foreground: '#ceca84', fontStyle: 'italic' },
144156
{ token: 'responses', foreground: '#ceca84', fontStyle: 'italic' },
@@ -156,6 +168,11 @@ export default {
156168
{ token: 'components-callbacks', foreground: '#ceca84', fontStyle: 'bold' },
157169
{ token: 'components-pathItems', foreground: '#ceca84', fontStyle: 'bold' },
158170
{ token: 'components-path-items', foreground: '#ceca84', fontStyle: 'bold' },
171+
// AsyncAPI 3 specific components: bold olive green
172+
{ token: 'components-replies', foreground: '#ceca84', fontStyle: 'bold' },
173+
{ token: 'components-reply-addresses', foreground: '#ceca84', fontStyle: 'bold' },
174+
{ token: 'components-tags', foreground: '#ceca84', fontStyle: 'bold' },
175+
{ token: 'components-external-documentation', foreground: '#ceca84', fontStyle: 'bold' },
159176
// plain value: green
160177
{ token: 'value', foreground: '#98C379' },
161178
{ token: 'value.string', foreground: '#98C379' },
@@ -179,9 +196,15 @@ export default {
179196
{ token: 'operation-example', foreground: '#1de2fa' },
180197
{ token: 'operation-callbacks', foreground: '#1de2fa' },
181198
{ token: 'securityScheme', foreground: '#1de2fa' },
199+
{ token: 'securityRequirement', foreground: '#1de2fa' },
182200
{ token: 'server-variables', foreground: '#1de2fa' },
183201
{ token: 'messageTrait', foreground: '#1de2fa' },
184202
{ token: 'operationTrait', foreground: '#1de2fa' },
203+
// bindings: sky blue
204+
{ token: 'channel-binding', foreground: '#1de2fa' },
205+
// AsyncAPI 3 specific: sky blue
206+
{ token: 'operationReply', foreground: '#1de2fa' },
207+
{ token: 'operationReplyAddress', foreground: '#1de2fa' },
185208
// tokens exist in apidom-ls, but not working in editor, sky blue
186209
{ token: 'version', foreground: '#1de2fa' },
187210
{ token: 'title', foreground: '#1de2fa' },

src/plugins/editor-monaco/themes/se-vs-light.js

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,22 @@ export default {
117117
{ token: 'externalDocumentation', foreground: '#000033', fontStyle: 'bold' },
118118
// additional top-level tokens for AsyncAPI Object: bold dark grey with purple tint
119119
{ token: 'spec-version', foreground: '#000033', fontStyle: 'bold' }, // e.g. asyncapi
120+
{ token: 'defaultContentType', foreground: '#000033', fontStyle: 'bold' },
120121
{ token: 'channels', foreground: '#000033', fontStyle: 'bold' },
122+
{ token: 'operations', foreground: '#000033', fontStyle: 'bold' },
121123
// messages tokens: purple
122124
{ token: 'components-messages', foreground: '#993399', fontStyle: 'bold' },
125+
{ token: 'components-messageTraits', foreground: '#993399', fontStyle: 'bold' },
123126
{ token: 'messages', foreground: '#993399', fontStyle: 'italic' },
124127
{ token: 'message', foreground: '#993399' },
128+
{ token: 'messageTraits', foreground: '#993399', fontStyle: 'italic' },
129+
{ token: 'messageExample', foreground: '#993399' },
125130
// operation tokens: swagger-ui-post=green, swagger-ui-get=blue
131+
{ token: 'components-operations', foreground: '#66afce', fontStyle: 'bold' },
132+
{ token: 'components-operationTraits', foreground: '#66afce', fontStyle: 'bold' },
126133
{ token: 'operation', foreground: '#66afce', fontStyle: 'bold' }, // light blue
134+
{ token: 'operationTraits', foreground: '#66afce', fontStyle: 'italic' },
135+
{ token: 'operationBindings', foreground: '#66afce' },
127136
{ token: 'operation.httpMethod-GET', foreground: '#006699', fontStyle: 'bold' }, // blue-grey
128137
{ token: 'operation.httpMethod-POST', foreground: '#339966', fontStyle: 'bold' }, // dark teal
129138
// parameters tokens: purple
@@ -136,9 +145,12 @@ export default {
136145
// components/{schemas}/schema: bold olive green
137146
{ token: 'components-schemas', foreground: '#666633', fontStyle: 'bold' },
138147
{ token: 'schema', foreground: '#666633', fontStyle: 'bold' },
139-
// pathItem & channelItem: bold olive green
148+
{ token: 'multiFormatSchema', foreground: '#666633', fontStyle: 'bold' },
149+
// pathItem, channel & channelItem: bold olive green
140150
{ token: 'pathItem', foreground: '#666633', fontStyle: 'bold' },
141151
{ token: 'channelItem', foreground: '#666633', fontStyle: 'bold' },
152+
{ token: 'channel', foreground: '#666633', fontStyle: 'bold' },
153+
{ token: 'components-channels', foreground: '#666633', fontStyle: 'bold' },
142154
// request & response: olive green
143155
{ token: 'requestBody', foreground: '#666633', fontStyle: 'italic' },
144156
{ token: 'responses', foreground: '#666633', fontStyle: 'italic' },
@@ -156,6 +168,11 @@ export default {
156168
{ token: 'components-callbacks', foreground: '#666633', fontStyle: 'bold' },
157169
{ token: 'components-pathItems', foreground: '#666633', fontStyle: 'bold' },
158170
{ token: 'components-path-items', foreground: '#666633', fontStyle: 'bold' },
171+
// AsyncAPI 3 specific components: bold olive green
172+
{ token: 'components-replies', foreground: '#666633', fontStyle: 'bold' },
173+
{ token: 'components-replyAddresses', foreground: '#666633', fontStyle: 'bold' },
174+
{ token: 'components-tags', foreground: '#666633', fontStyle: 'bold' },
175+
{ token: 'components-externalDocs', foreground: '#666633', fontStyle: 'bold' },
159176
// plain value: green
160177
{ token: 'value', foreground: '#339933' },
161178
{ token: 'value.string', foreground: '#339933' },
@@ -179,9 +196,15 @@ export default {
179196
{ token: 'operation-example', foreground: '#0099cc' },
180197
{ token: 'operation-callbacks', foreground: '#0099cc' },
181198
{ token: 'securityScheme', foreground: '#0099cc' },
199+
{ token: 'securityRequirement', foreground: '#0099cc' },
182200
{ token: 'server-variables', foreground: '#0099cc' },
183201
{ token: 'messageTrait', foreground: '#0099cc' },
184202
{ token: 'operationTrait', foreground: '#0099cc' },
203+
// bindings: sky blue
204+
{ token: 'channel-binding', foreground: '#0099cc' },
205+
// AsyncAPI 3 specific: sky blue
206+
{ token: 'operationReply', foreground: '#0099cc' },
207+
{ token: 'operationReplyAddress', foreground: '#0099cc' },
185208
// tokens exist in apidom-ls, but not working in editor, sky blue
186209
{ token: 'version', foreground: '#0099cc' },
187210
{ token: 'title', foreground: '#0099cc' },

0 commit comments

Comments
 (0)