jsonnext / codemirror-json-schema

A JSONSchema enabled mode for codemirror 6, for json4 and json5, inspired by monaco-json
https://codemirror-json-schema.netlify.app
MIT License
57 stars 9 forks source link

Added YAML support #85

Closed imolorhe closed 4 months ago

imolorhe commented 5 months ago

Closes #84

To support YAML (and potentially other formats), I updated the logic to "resolve" tokens before using them. This is important since the YAML grammar/tokens is different from the JSON grammar/tokens (which is very similar to the JSON5 grammar). So we map the tokens from the different grammars to the equivalent token in the "base" grammar (currently this is the JSON grammar tokens but I think we can/should map to some other arbitrary token set which will force us to properly implement the mappings, otherwise additional changes made may work in JSON mode but without proper testing, may not work in YAML mode, if the mappings were not added).

changeset-bot[bot] commented 5 months ago

🦋 Changeset detected

Latest commit: f5b1ebfbd76e0dfab13243b7d68d985045aa6936

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ---------------------- | ----- | | codemirror-json-schema | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

netlify[bot] commented 5 months ago

Deploy Preview for codemirror-json-schema ready!

Name Link
Latest commit f5b1ebfbd76e0dfab13243b7d68d985045aa6936
Latest deploy log https://app.netlify.com/sites/codemirror-json-schema/deploys/65d7fb736df40d0008720113
Deploy Preview https://deploy-preview-85--codemirror-json-schema.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

acao commented 4 months ago

oh this is BEAUTIFUL