diff --git a/src/plugins/editor-monaco-language-apidom/language/apidom.js b/src/plugins/editor-monaco-language-apidom/language/apidom.js index fbb95d77108..e87bc349d71 100644 --- a/src/plugins/editor-monaco-language-apidom/language/apidom.js +++ b/src/plugins/editor-monaco-language-apidom/language/apidom.js @@ -45,7 +45,19 @@ export const conf = { export const monarchLanguageDef = { // set defaultToken to invalid to see what you do not tokenize yet defaultToken: 'invalid', - keywords: ['swagger', 'info', 'host', 'basePath', 'tags', 'schemes', 'paths', 'externalDocs'], + keywords: [ + 'swagger', + 'info', + 'host', + 'basePath', + 'tags', + 'schemes', + 'paths', + 'externalDocs', + 'description', + 'content', + 'default', + ], typeKeywords: ['description', 'title', 'termsOfService'], escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/, // the main tokenizer for our languages diff --git a/src/plugins/editor-monaco/themes/se-vs-dark.js b/src/plugins/editor-monaco/themes/se-vs-dark.js index 29d8db82ca8..cf015844ff7 100644 --- a/src/plugins/editor-monaco/themes/se-vs-dark.js +++ b/src/plugins/editor-monaco/themes/se-vs-dark.js @@ -1,198 +1,14 @@ -const darkThemeMap = { - parameter: 5, - specVersion: 6, - version: 6, - 'api-version': 6, - 'spec-version': 6, - info: 6, - operation: { - default: 7, - 'httpMethod-GET': 5, // light blue - 'httpMethod-POST': 7, // light green - }, - key: { - string: 0, - number: 5, - }, - value: { - string: 0, - number: 5, - }, - pathItem: 13, - components: 9, - 'components-parameters': 17, - 'components-schemas': 17, - 'components-messages': 17, - 'components-request-bodies': 17, - 'components-examples': 17, - 'components-headers': 17, - 'components-security-schemes': 17, - 'components-links': 17, - 'components-callbacks': 17, - 'components-path-items': 17, - 'openapi-reference': 9, - 'server-url': 0, - 'Asyncapi-reference': 9, - 'json-reference': 9, - 'reference-element': 7, - 'reference-value': 13, - content: 5, - mediaType: 5, - openapi: 6, - parameters: 17, - paths: 17, - reference: 9, - requestBody: 12, - response: 12, - responses: 17, - schema: 9, - server: 5, - servers: 17, - title: 6, - asyncApiVersion: 6, - channelItem: 13, - channels: 17, - tags: 6, - webhooks: 6, - contact: 6, - license: 6, - externalDocumentation: 6, - 'server-description': 6, - 'server-variables': 6, - 'operation-callbacks': 6, - callback: 6, - messageTraits: 17, - operationTraits: 17, -}; - -export const getStyleMetadataDark = (type, modifiers) => { - let color = 5; - - if (modifiers && modifiers.length > 0) { - color = darkThemeMap[type][modifiers[0]] ? darkThemeMap[type][modifiers[0]] : 5; - } else { - color = darkThemeMap[type]; - if (!color) { - color = darkThemeMap[type] && darkThemeMap[type].default ? darkThemeMap[type].default : 5; - } - } +import themeRules from './theme-rules.ts'; - return { - foreground: color, - bold: false, - underline: false, - italic: false, - }; +const colors = { + keyword: '#CB973C', + value: '#EAEBEB', }; export default { base: 'vs-dark', - inherit: true, - rules: [ - // tokens for OpenAPI 2.0 Object: bold, with light purple-white - { token: 'swagger-host', foreground: '#d0d0e3', fontStyle: 'bold' }, - { token: 'swagger-base-path', foreground: '#d0d0e3', fontStyle: 'bold' }, - { token: 'swagger-schemes', foreground: '#d0d0e3', fontStyle: 'bold' }, - { token: 'swagger-consumes', foreground: '#d0d0e3', fontStyle: 'bold' }, - { token: 'swagger-produces', foreground: '#d0d0e3', fontStyle: 'bold' }, - { token: 'swagger-security', foreground: '#d0d0e3', fontStyle: 'bold' }, - { token: 'swagger-tags', foreground: '#d0d0e3', fontStyle: 'bold' }, - { token: 'definitions', foreground: '#d0d0e3', fontStyle: 'bold' }, - { token: 'parameterDefinitions', foreground: '#d0d0e3', fontStyle: 'bold' }, - { token: 'responseDefinitions', foreground: '#d0d0e3', fontStyle: 'bold' }, - { token: 'securityDefinitions', foreground: '#d0d0e3', fontStyle: 'bold' }, - { token: 'externalDocumentation', foreground: '#d0d0e3', fontStyle: 'bold' }, - { token: 'operation-consumes', foreground: '#d0d0e3', fontStyle: 'bold' }, - { token: 'operation-produces', foreground: '#d0d0e3', fontStyle: 'bold' }, - // top-level tokens for OpenAPI 3.x.y Object: bold, with light purple-white - { token: 'openapi', foreground: '#d0d0e3', fontStyle: 'bold' }, - { token: 'info', foreground: '#d0d0e3', fontStyle: 'bold' }, - { token: 'jsonSchemaDialect', foreground: '#d0d0e3', fontStyle: 'bold' }, - { token: 'servers', foreground: '#d0d0e3', fontStyle: 'bold' }, - { token: 'paths', foreground: '#d0d0e3', fontStyle: 'bold' }, - { token: 'webhooks', foreground: '#d0d0e3', fontStyle: 'bold' }, - { token: 'components', foreground: '#d0d0e3', fontStyle: 'bold' }, - { token: 'security', foreground: '#d0d0e3', fontStyle: 'bold' }, - { token: 'tags', foreground: '#d0d0e3', fontStyle: 'bold' }, - { 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: 'channels', foreground: '#d0d0e3', fontStyle: 'bold' }, - // messages tokens: purple - { token: 'components-messages', foreground: '#C678DD', fontStyle: 'bold' }, - { token: 'messages', foreground: '#C678DD', fontStyle: 'italic' }, - { token: 'message', foreground: '#C678DD' }, - // operation tokens: swagger-ui-post=green, swagger-ui-get=blue - { token: 'operation', foreground: '#66afce', fontStyle: 'bold' }, // light blue - { token: 'operation.httpMethod-GET', foreground: '#0099ff', fontStyle: 'bold' }, // blue - { token: 'operation.httpMethod-POST', foreground: '#00cc99', fontStyle: 'bold' }, // teal - // parameters tokens: purple - { token: 'parameters', foreground: '#C678DD', fontStyle: 'italic' }, - { token: 'parameter', foreground: '#C678DD', fontStyle: 'italic' }, - { token: 'components-parameters', foreground: '#C678DD', fontStyle: 'bold' }, - // reference & $refs tokens: orange - { token: 'reference-element', foreground: '#ff5500', fontStyle: 'bold' }, - { token: 'reference-value', foreground: '#ffddcc', fontStyle: 'italic' }, - // 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: 'pathItem', foreground: '#ceca84', fontStyle: 'bold' }, - { token: 'channelItem', foreground: '#ceca84', fontStyle: 'bold' }, - // request & response: olive green - { token: 'requestBody', foreground: '#ceca84', fontStyle: 'italic' }, - { token: 'responses', foreground: '#ceca84', fontStyle: 'italic' }, - { token: 'components-responses', foreground: '#ceca84', fontStyle: 'bold' }, - { token: 'components-request-bodies', foreground: '#ceca84', fontStyle: 'bold' }, - { token: 'content', foreground: '#ceca84' }, - { token: 'mediaType', foreground: '#ceca84' }, - { token: 'response', foreground: '#ceca84' }, - { token: 'server', foreground: '#ceca84' }, - // additional components: bold olive green - { token: 'components-examples', foreground: '#ceca84', fontStyle: 'bold' }, - { token: 'components-headers', foreground: '#ceca84', fontStyle: 'bold' }, - { token: 'components-links', foreground: '#ceca84', fontStyle: 'bold' }, - { token: 'components-security-schemes', foreground: '#ceca84', fontStyle: 'bold' }, - { token: 'components-callbacks', foreground: '#ceca84', fontStyle: 'bold' }, - { token: 'components-pathItems', foreground: '#ceca84', fontStyle: 'bold' }, - { token: 'components-path-items', foreground: '#ceca84', fontStyle: 'bold' }, - // plain value: green - { token: 'value', foreground: '#98C379' }, - { token: 'value.string', foreground: '#98C379' }, - { token: 'value.number', foreground: '#98C379' }, - // plain key: pinkish-orange, which appears light orange - { token: 'key.string', foreground: '#e8b9bb' }, - { token: 'key.number', foreground: '#e8b9bb' }, - // misc token key/value pair: sky blue - { token: 'api-version', foreground: '#1de2fa' }, // version inside of info object - { token: 'server-url', foreground: '#1de2fa' }, - // misc token object: sky blue - { token: 'callback', foreground: '#1de2fa' }, - { token: 'contact', foreground: '#1de2fa' }, - { token: 'discriminator', foreground: '#1de2fa' }, - { token: 'example', foreground: '#1de2fa' }, // only when examples.example - { token: 'examples', foreground: '#1de2fa' }, - { token: 'header', foreground: '#1de2fa' }, - { token: 'license', foreground: '#1de2fa' }, - { token: 'oAuthFlow', foreground: '#1de2fa' }, - { token: 'oAuthFlows', foreground: '#1de2fa' }, - { token: 'operation-example', foreground: '#1de2fa' }, - { token: 'operation-callbacks', foreground: '#1de2fa' }, - { token: 'securityScheme', foreground: '#1de2fa' }, - { token: 'server-variables', foreground: '#1de2fa' }, - { token: 'messageTrait', foreground: '#1de2fa' }, - { token: 'operationTrait', foreground: '#1de2fa' }, - // tokens exist in apidom-ls, but not working in editor, sky blue - { token: 'version', foreground: '#1de2fa' }, - { token: 'title', foreground: '#1de2fa' }, - { token: 'specVersion', foreground: '#1de2fa' }, - { token: 'asyncApiVersion', foreground: '#1de2fa' }, - // tokens exist in apidom-ls, but not working in editor, may be orange-ish to match other reference(s) - { token: 'openapi-reference', foreground: '#ff9966' }, - { token: 'reference', foreground: '#ff9966' }, - { token: 'asyncapi-reference', foreground: '#ff9966' }, - { token: 'json-reference', foreground: '#ff9966' }, - ], + inherit: false, + rules: themeRules(colors), colors: { 'editor.background': '#282c34', 'editor.foreground': '#abb2bf', diff --git a/src/plugins/editor-monaco/themes/se-vs-light.js b/src/plugins/editor-monaco/themes/se-vs-light.js index 125a006d133..757540840f7 100644 --- a/src/plugins/editor-monaco/themes/se-vs-light.js +++ b/src/plugins/editor-monaco/themes/se-vs-light.js @@ -1,198 +1,14 @@ -const lightThemeMap = { - parameter: 5, - specVersion: 6, - version: 6, - 'api-version': 6, - 'spec-version': 6, - info: 6, - operation: { - default: 7, - 'httpMethod-GET': 5, // light blue - 'httpMethod-POST': 7, // light green - }, - key: { - string: 0, - number: 5, - }, - value: { - string: 0, - number: 5, - }, - pathItem: 13, - components: 9, - 'components-parameters': 17, - 'components-schemas': 17, - 'components-messages': 17, - 'components-request-bodies': 17, - 'components-examples': 17, - 'components-headers': 17, - 'components-security-schemes': 17, - 'components-links': 17, - 'components-callbacks': 17, - 'components-path-items': 17, - 'openapi-reference': 9, - 'server-url': 0, - 'Asyncapi-reference': 9, - 'json-reference': 9, - 'reference-element': 7, - 'reference-value': 13, - content: 5, - mediaType: 5, - openapi: 6, - parameters: 17, - paths: 17, - reference: 9, - requestBody: 12, - response: 12, - responses: 17, - schema: 9, - server: 5, - servers: 17, - title: 6, - asyncApiVersion: 6, - channelItem: 13, - channels: 17, - tags: 6, - webhooks: 6, - contact: 6, - license: 6, - externalDocumentation: 6, - 'server-description': 6, - 'server-variables': 6, - 'operation-callbacks': 6, - callback: 6, - messageTraits: 17, - operationTraits: 17, -}; - -export const getStyleMetadataLight = (type, modifiers) => { - let color = 5; - - if (modifiers && modifiers.length > 0) { - color = lightThemeMap[type][modifiers[0]] ? lightThemeMap[type][modifiers[0]] : 5; - } else { - color = lightThemeMap[type]; - if (!color) { - color = lightThemeMap[type] && lightThemeMap[type].default ? lightThemeMap[type].default : 5; - } - } +import themeRules from './theme-rules.ts'; - return { - foreground: color, - bold: false, - underline: false, - italic: false, - }; +const colors = { + keyword: '#9A6200', + value: '#434B4F', }; export default { base: 'vs', // can also be vs-dark or hc-black - inherit: true, // can also be false to completely replace the builtin rules - rules: [ - // tokens for OpenAPI 2.0 Object: bold, with light purple-white - { token: 'swagger-host', foreground: '#000033', fontStyle: 'bold' }, - { token: 'swagger-base-path', foreground: '#000033', fontStyle: 'bold' }, - { token: 'swagger-schemes', foreground: '#000033', fontStyle: 'bold' }, - { token: 'swagger-consumes', foreground: '#000033', fontStyle: 'bold' }, - { token: 'swagger-produces', foreground: '#000033', fontStyle: 'bold' }, - { token: 'swagger-security', foreground: '#000033', fontStyle: 'bold' }, - { token: 'swagger-tags', foreground: '#000033', fontStyle: 'bold' }, - { token: 'definitions', foreground: '#000033', fontStyle: 'bold' }, - { token: 'parameterDefinitions', foreground: '#000033', fontStyle: 'bold' }, - { token: 'responseDefinitions', foreground: '#000033', fontStyle: 'bold' }, - { token: 'securityDefinitions', foreground: '#000033', fontStyle: 'bold' }, - { token: 'externalDocumentation', foreground: '#000033', fontStyle: 'bold' }, - { token: 'operation-consumes', foreground: '#000033', fontStyle: 'bold' }, - { token: 'operation-produces', foreground: '#000033', fontStyle: 'bold' }, - // top-level tokens for OpenAPI 3.x.y Object: bold dark grey with purple tint - { token: 'openapi', foreground: '#000033', fontStyle: 'bold' }, - { token: 'info', foreground: '#000033', fontStyle: 'bold' }, - { token: 'jsonSchemaDialect', foreground: '#000033', fontStyle: 'bold' }, - { token: 'servers', foreground: '#000033', fontStyle: 'bold' }, - { token: 'paths', foreground: '#000033', fontStyle: 'bold' }, - { token: 'webhooks', foreground: '#000033', fontStyle: 'bold' }, - { token: 'components', foreground: '#000033', fontStyle: 'bold' }, - { token: 'security', foreground: '#000033', fontStyle: 'bold' }, - { token: 'tags', foreground: '#000033', fontStyle: 'bold' }, - { 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: 'channels', foreground: '#000033', fontStyle: 'bold' }, - // messages tokens: purple - { token: 'components-messages', foreground: '#993399', fontStyle: 'bold' }, - { token: 'messages', foreground: '#993399', fontStyle: 'italic' }, - { token: 'message', foreground: '#993399' }, - // operation tokens: swagger-ui-post=green, swagger-ui-get=blue - { token: 'operation', foreground: '#66afce', fontStyle: 'bold' }, // light blue - { token: 'operation.httpMethod-GET', foreground: '#006699', fontStyle: 'bold' }, // blue-grey - { token: 'operation.httpMethod-POST', foreground: '#339966', fontStyle: 'bold' }, // dark teal - // parameters tokens: purple - { token: 'parameters', foreground: '#993399', fontStyle: 'italic' }, - { token: 'parameter', foreground: '#993399', fontStyle: 'italic' }, - { token: 'components-parameters', foreground: '#993399', fontStyle: 'bold' }, - // reference & $refs tokens: orange - { token: 'reference-element', foreground: '#cc3300', fontStyle: 'bold' }, - { token: 'reference-value', foreground: '#ff5500', fontStyle: 'italic' }, - // 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: 'pathItem', foreground: '#666633', fontStyle: 'bold' }, - { token: 'channelItem', foreground: '#666633', fontStyle: 'bold' }, - // request & response: olive green - { token: 'requestBody', foreground: '#666633', fontStyle: 'italic' }, - { token: 'responses', foreground: '#666633', fontStyle: 'italic' }, - { token: 'components-responses', foreground: '#666633', fontStyle: 'bold' }, - { token: 'components-request-bodies', foreground: '#666633', fontStyle: 'bold' }, - { token: 'content', foreground: '#666633' }, - { token: 'mediaType', foreground: '#666633' }, - { token: 'response', foreground: '#666633' }, - { token: 'server', foreground: '#666633' }, - // additional components: bold olive green - { token: 'components-examples', foreground: '#666633', fontStyle: 'bold' }, - { token: 'components-headers', foreground: '#666633', fontStyle: 'bold' }, - { token: 'components-links', foreground: '#666633', fontStyle: 'bold' }, - { token: 'components-security-schemes', foreground: '#666633', fontStyle: 'bold' }, - { token: 'components-callbacks', foreground: '#666633', fontStyle: 'bold' }, - { token: 'components-pathItems', foreground: '#666633', fontStyle: 'bold' }, - { token: 'components-path-items', foreground: '#666633', fontStyle: 'bold' }, - // plain value: green - { token: 'value', foreground: '#339933' }, - { token: 'value.string', foreground: '#339933' }, - { token: 'value.number', foreground: '#339933' }, - // plain key: pumpkin - { token: 'key.string', foreground: '#cc6600' }, - { token: 'key.number', foreground: '#cc6600' }, - // misc token key/value pair: sky blue - { token: 'api-version', foreground: '#0099cc' }, // version inside of info object - { token: 'server-url', foreground: '#0099cc' }, - // misc token object: sky blue - { token: 'callback', foreground: '#0099cc' }, - { token: 'contact', foreground: '#0099cc' }, - { token: 'discriminator', foreground: '#0099cc' }, - { token: 'example', foreground: '#0099cc' }, // only when examples.example - { token: 'examples', foreground: '#0099cc' }, - { token: 'header', foreground: '#0099cc' }, - { token: 'license', foreground: '#0099cc' }, - { token: 'oAuthFlow', foreground: '#0099cc' }, - { token: 'oAuthFlows', foreground: '#0099cc' }, - { token: 'operation-example', foreground: '#0099cc' }, - { token: 'operation-callbacks', foreground: '#0099cc' }, - { token: 'securityScheme', foreground: '#0099cc' }, - { token: 'server-variables', foreground: '#0099cc' }, - { token: 'messageTrait', foreground: '#0099cc' }, - { token: 'operationTrait', foreground: '#0099cc' }, - // tokens exist in apidom-ls, but not working in editor, sky blue - { token: 'version', foreground: '#0099cc' }, - { token: 'title', foreground: '#0099cc' }, - { token: 'specVersion', foreground: '#0099cc' }, - { token: 'asyncApiVersion', foreground: '#0099cc' }, - // tokens exist in apidom-ls, but not working in editor, may be orange-ish to match other reference(s) - { token: 'openapi-reference', foreground: '#ff9966' }, - { token: 'reference', foreground: '#ff9966' }, - { token: 'asyncapi-reference', foreground: '#ff9966' }, - { token: 'json-reference', foreground: '#ff9966' }, - ], + inherit: false, // can also be false to completely replace the builtin rules + rules: themeRules(colors), colors: { 'editor.background': '#F9F9F9', 'editor.foreground': '#383a42', diff --git a/src/plugins/editor-monaco/themes/theme-rules.ts b/src/plugins/editor-monaco/themes/theme-rules.ts new file mode 100644 index 00000000000..6772cf40908 --- /dev/null +++ b/src/plugins/editor-monaco/themes/theme-rules.ts @@ -0,0 +1,113 @@ +type ThemeColors = { + keyword: string; + value: string; +}; + +const themeRules = (colors: ThemeColors) => { + const plainKey = colors.keyword; + const plainValue = colors.value; + + return [ + // tokens for OpenAPI 2.0 Object + { token: 'swagger-host', foreground: colors.keyword }, + { token: 'swagger-base-path', foreground: colors.keyword }, + { token: 'swagger-schemes', foreground: colors.keyword }, + { token: 'swagger-consumes', foreground: colors.keyword }, + { token: 'swagger-produces', foreground: colors.keyword }, + { token: 'swagger-security', foreground: colors.keyword }, + { token: 'swagger-tags', foreground: colors.keyword }, + { token: 'definitions', foreground: colors.keyword }, + { token: 'parameterDefinitions', foreground: colors.keyword }, + { token: 'responseDefinitions', foreground: colors.keyword }, + { token: 'securityDefinitions', foreground: colors.keyword }, + { token: 'externalDocumentation', foreground: colors.keyword }, + { token: 'operation-consumes', foreground: colors.keyword }, + { token: 'operation-produces', foreground: colors.keyword }, + // top-level tokens for OpenAPI 3.x.y Object + { token: 'openapi', foreground: colors.keyword }, + { token: 'info', foreground: colors.keyword }, + { token: 'jsonSchemaDialect', foreground: colors.keyword }, + { token: 'servers', foreground: colors.keyword }, + { token: 'paths', foreground: colors.keyword }, + { token: 'webhooks', foreground: colors.keyword }, + { token: 'components', foreground: colors.keyword }, + { token: 'security', foreground: colors.keyword }, + { token: 'tags', foreground: colors.keyword }, + { token: 'tag', foreground: colors.keyword }, + // additional top-level tokens for AsyncAPI Object + { token: 'spec-version', foreground: colors.keyword }, // e.g. asyncapi + { token: 'channels', foreground: colors.keyword }, + { token: 'components-messages', foreground: colors.keyword }, + { token: 'messages', foreground: colors.keyword }, + { token: 'message', foreground: colors.keyword }, + { token: 'operation', foreground: colors.keyword }, + { token: 'operation.httpMethod-GET', foreground: colors.keyword }, + { token: 'operation.httpMethod-POST', foreground: colors.keyword }, + { token: 'parameters', foreground: colors.keyword }, + { token: 'parameter', foreground: colors.keyword }, + { token: 'components-parameters', foreground: colors.keyword }, + { token: 'reference-element', foreground: colors.keyword }, + { token: 'reference-value', foreground: colors.value }, + { token: 'components-schemas', foreground: colors.keyword }, + { token: 'schema', foreground: colors.keyword }, + { token: 'pathItem', foreground: colors.keyword }, + { token: 'channelItem', foreground: colors.keyword }, + { token: 'requestBody', foreground: colors.keyword }, + { token: 'responses', foreground: colors.keyword }, + { token: 'components-responses', foreground: colors.keyword }, + { token: 'components-request-bodies', foreground: colors.keyword }, + { token: 'content', foreground: colors.keyword }, + { token: 'mediaType', foreground: colors.keyword }, + { token: 'response', foreground: colors.keyword }, + { token: 'server', foreground: colors.keyword }, + // additional components + { token: 'components-examples', foreground: colors.keyword }, + { token: 'components-headers', foreground: colors.keyword }, + { token: 'components-links', foreground: colors.keyword }, + { token: 'components-security-schemes', foreground: colors.keyword }, + { token: 'components-callbacks', foreground: colors.keyword }, + { token: 'components-pathItems', foreground: colors.keyword }, + { token: 'components-path-items', foreground: colors.keyword }, + // plain value + { token: 'value', foreground: plainValue }, + { token: 'value.string', foreground: plainValue }, + { token: 'value.number', foreground: plainValue }, + // plain key + { token: 'key.string', foreground: plainKey }, + { token: 'key.number', foreground: plainKey }, + // token key/value pair + { token: 'api-version', foreground: colors.keyword }, // version inside of info object + { token: 'server-url', foreground: colors.keyword }, + // token object + { token: 'callback', foreground: colors.keyword }, + { token: 'contact', foreground: colors.keyword }, + { token: 'discriminator', foreground: colors.keyword }, + { token: 'example', foreground: colors.keyword }, // only when examples.example + { token: 'examples', foreground: colors.keyword }, + { token: 'header', foreground: colors.keyword }, + { token: 'license', foreground: colors.keyword }, + { token: 'oAuthFlow', foreground: colors.keyword }, + { token: 'oAuthFlows', foreground: colors.keyword }, + { token: 'operation-example', foreground: colors.keyword }, + { token: 'operation-callbacks', foreground: colors.keyword }, + { token: 'securityScheme', foreground: colors.keyword }, + { token: 'server-variables', foreground: colors.keyword }, + { token: 'messageTrait', foreground: colors.keyword }, + { token: 'operationTrait', foreground: colors.keyword }, + // tokens exist in apidom-ls, but not working in editor + { token: 'version', foreground: colors.keyword }, + { token: 'title', foreground: colors.keyword }, + { token: 'specVersion', foreground: colors.keyword }, + { token: 'asyncApiVersion', foreground: colors.keyword }, + { token: 'openapi-reference', foreground: colors.keyword }, + { token: 'reference', foreground: colors.keyword }, + { token: 'asyncapi-reference', foreground: colors.keyword }, + { token: 'json-reference', foreground: colors.keyword }, + { token: 'keyword', foreground: colors.keyword }, + { token: '', foreground: colors.value }, + { token: 'type', foreground: colors.keyword }, + { token: 'invalid', foreground: colors.keyword }, + ]; +}; + +export default themeRules;