Skip to content

Tolerate trailing commas in jsonc format (breakage) #177584

Closed

Description

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.76.2
  • OS Version: macOS 13.1

Steps to Reproduce:

  1. Write a jsonc file with trailing commas.
  2. Observe that VS Code complains about them.

This seems to be a breakage of this solution which used to work – until the last VS Code update, I believe.

Activity

  1. aeschli commented on Mar 20, 2023

    @aeschli
    Contributor

    Nothing changed recently, but we have two flavours of JSON with Comment. One with just comments (a.) and one with comments and trailing commas (b.)
    (a.) is the default. To get b., you also need a JSON schema associated that has "allowTrailingCommas": true, set as seen in #102061 (comment). I verified in the latest build that this still correctly works.

    If this doesn't work for you, can you give a reproducible example?

  2. added
    info-needed
    on Mar 20, 2023
  3. tonyvg2013 commented on Mar 20, 2023

    @tonyvg2013
  4. alexreg commented on Mar 21, 2023

    @alexreg
    Author

    Martin Aeschlimann (@aeschli) Thanks for the reply. I've figured out what's particular about my case: I have a workspace open with the correct JSON schemas configuration in the workspace's settings.json, but the JSON file in question is outside of this workspace, even though it's open in the workspace's window and matches fileMatch (or at least used to). So, the workspace's settings must have applied to such files before, but not any more. Is this scenario still supported in some other way?

  5. aeschli commented on Mar 21, 2023

    @aeschli
    Contributor

    Ok, yes, no I realize there have been changes there. We now apply the workspace settings only to files located in that workspace.

  6. alexreg commented on Mar 21, 2023

    @alexreg
    Author

    J/A (@archer884) Okay, fair enough. No "workaround" for this then? If so, feel free to close it.

  7. aeschli commented on Mar 23, 2023

    @aeschli
    Contributor

    Fixed by #178008

  8. alexreg commented on Mar 23, 2023

    @alexreg
    Author

    Martin Aeschlimann (@aeschli) Thanks, that's super.

  9. locked and limited conversation to collaborators on May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

info-needed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions