Skip to content

Add a JSONC language variant for "JSON with Comments" #2016

Closed
@michaelblyons

Description

@michaelblyons

Similar to #406, which correctly points out that comments are not permitted in the JSON spec, can a new, very similar language be added that does permit comments and trailing commas?

This is often used in configuration files for (among other things) VS Code and Sublime Text. Github comparison of codefences for json versus jsonc:

[
    // The foo
    { "foo": [ "baz", 4, true ] },
    // The bar
    { "bar": [ "biff", 10, false ] },
]
[
    // The foo
    { "foo": [ "baz", 4, true ] },
    // The bar
    { "bar": [ "biff", 10, false ] },
]

Right now, I use javascript for these like #406 suggests, but it is much easier to discriminate keys and values with the JSON highlighting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions