Skip to content

Conversation

@glowcloud
Copy link
Contributor

@glowcloud glowcloud commented Jan 21, 2026

Adds an option useApiDOMSyntaxHighlighting to editor-monaco-language-apidom plugin to choose between simplified syntax highlighting with tokens based on regular expressions or syntax highlighting with tokens provided by ApiDOM Language Service. The simplified syntax highlighting is enabled by default.

TODO:

  • JSON whitespaces (e.g. <key>:<value>, <key>: <value>, <key>: <value> , )
  • JSON and YAML objects on a single line (e.g. { <key>: <value> }, also just <key>: <value>, <key>: <value> as object can start on the previous line)
  • JSON and YAML arrays on a single line (e.g. [123, '123', true, [123]])
  • YAML arrays on multiple lines
  • JSON inline objects from the start (e.g. { "openapi": "3.0.4", "info": { ... } }) => root needs to handle single line definitions)
  • simplify if possible
  • make it configurable (plugin opts?)

NOTE: Editor component is wrapped to pass down the option to colourise brackets, as using editor.updateOptions({'bracketPairColorization.enabled': true}) and/or editor.updateOptions({bracketPairColorization: { enabled: true }}) does not have any effect. As brackets are not colourised/tokenised by ApiDOM, we need to be able to change this option, so a workaround with wrapping and passing down a prop was used.

@glowcloud glowcloud self-assigned this Jan 21, 2026
@glowcloud glowcloud added the enhancement New feature or request label Jan 21, 2026
@glowcloud glowcloud changed the title poc: simplify syntax highlighting feat: add simple syntax highlighting Jan 23, 2026
@glowcloud glowcloud changed the title feat: add simple syntax highlighting feat: add simplified syntax highlighting Jan 23, 2026
@glowcloud glowcloud marked this pull request as ready for review January 23, 2026 14:34
@glowcloud glowcloud merged commit 87ef597 into main Jan 26, 2026
5 checks passed
@glowcloud glowcloud deleted the poc/simple-syntax-highlighting branch January 26, 2026 13:49
swagger-bot pushed a commit that referenced this pull request Jan 26, 2026
# [5.1.0](v5.0.6...v5.1.0) (2026-01-26)

### Bug Fixes

* lint errors ([518950e](518950e))
* resolve Windows path issue with monaco-editor import ([2bc3930](2bc3930)), closes [#5679](#5679)

### Features

* add simplified syntax highlighting ([#5693](#5693)) ([87ef597](87ef597))
@swagger-bot
Copy link
Contributor

🎉 This PR is included in version 5.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants