Phrogz / vscode-neatjson

Extension for Visual Studio Code to provide custom formatting of JSON

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot accept JSONC or JSON5

Phrogz opened this issue · comments

I'd like to be able to write JSON5 like:

{
   foo:true,     // Unquoted identifier is OK; also: comments!
   a:[1,2,3,],   /* Trailing comma in array */
   b:'trailing', // Trailing comma in object, and single-quoted string
}

and format it into JSON. This currently fails because JSON.parse() cannot parse that. Should look at an alternative robust JS value parser.

Fixed by 1f74851