vscode-json5
vscode-json5 copied to clipboard
comments before comma marked invalid
I have this strange behaviour with comments :
{
"field": value"
// This comment is not tolerated and marked as invalid
}
{
"field": value",
// This comment is tolerated, mind the comma. (same with multiline)
}
I feel that both should be valid syntax, but it's not clear to me from the main json5 page as it says "Single and multi-line comments are allowed."
Isn't your value in your example missing an opening quotation mark? eg: "value" vs value"?
I have detected the same issue (and with all quotes in place 😄 ):

Would be nice if comments before a comma were also correctly recognized. The red color is somewhat distracting.
Any chance this will be resolved (pull req merged) any time soon?