vscode-json5 icon indicating copy to clipboard operation
vscode-json5 copied to clipboard

comments before comma marked invalid

Open RodolpheGohard opened this issue 6 years ago • 3 comments

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."

RodolpheGohard avatar Jul 01 '19 12:07 RodolpheGohard

Isn't your value in your example missing an opening quotation mark? eg: "value" vs value"?

DarthFutuza avatar Feb 02 '20 17:02 DarthFutuza

I have detected the same issue (and with all quotes in place 😄 ):

image

Would be nice if comments before a comma were also correctly recognized. The red color is somewhat distracting.

ralfhandl avatar Mar 12 '21 15:03 ralfhandl

Any chance this will be resolved (pull req merged) any time soon?

chaeron avatar Jan 14 '23 18:01 chaeron