Skip to content

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 with a Language Server Protocol powered by 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
    • View JSON preview in side window

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

JSON for Humans as a syntax highlighter in Visual Studio Code.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Contributors