Skip to content

Syntax highlighter for JSONH in Visual Studio Code.

License

Notifications You must be signed in to change notification settings

jsonh-org/JsonhVscode

Repository files navigation

Visual Studio Marketplace

JSON for Humans.

JSON is great. Until you miss that trailing comma... or want to use comments. What about multiline strings? JSONH provides a much more elegant way to write JSON that's designed for humans rather than machines.

Since JSONH is compatible with JSON, any JSONH syntax can be represented with equivalent JSON.

JsonhVscode

JsonhVscode is a syntax highlighter for JSONH V2 using TextMate Grammars and JsonhTs.

Example

Features

  • JSONH syntax highlighter
  • JSONH language server:
    • Displays errors with error messages
    • Displays warnings for duplicate properties
    • Displays warnings for invalid schema according to $schema property

Dependencies

Known Issues

Root strings highlighted as property names

In the following example, the string "hello" is incorrectly highlighted as a property name of a braceless root object.

"hello"

Keys with newlines highlighted as invalid after omitted comma

In the following example, the property "\nc": "d" is incorrectly rendered as invalid.

"a": "b"
"
c": "d"

This can be worked around by adding a comma after the first property.

The reason is that property names end at the RegEx ,|(?=^[^:]*:) meaning a comma or the first line containing a colon.

About

Syntax highlighter for JSONH in Visual Studio Code.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project