Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence the "Comments are not permitted in JSON." error for the emmet snippets.json to match parsing behavior #215446

Open
robinmetral opened this issue Jun 13, 2024 · 0 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug confirmation-pending emmet Emmet related issues

Comments

@robinmetral
Copy link

robinmetral commented Jun 13, 2024

Type: Bug

The emmet snippets.json is tolerant to comments since #33818. This means that a snippets.json like this would still be parsed correctly and work as expected:

{
  // Hello!
  "html": {
    "snippets": {
      "hw": "{Hello world}"
    }
  }
}

However any comment in snippets.json will still be marked as an error by VSCode. In contrast, any comment in the VSCode settings.json is ignored.

emmet snippets.json VSCode settings.json
A comment on an emmet snippets.json is marked as an error A comment on a VSCode settings.json is not marked as an error

I assume that this behavior can be changed, since the emmet snippets.json is already being parsed in a way that's tolerant to comments. Can these errors be silenced to match the underlying parsing behavior?


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

Steps to Reproduce:

  1. create an emmet snippet.json file with comments
  2. notice the mismatch: the file is being parsed correctly, but the comment is marked as an error ("Comments are not permitted in JSON. (521)")

VS Code version: Code 1.90.0 (89de5a8, 2024-06-04T19:43:07.605Z)
OS version: Linux x64 6.5.0-35-generic snap
Modes:

@robinmetral robinmetral changed the title Silence the "No comments in JSON" error for the emmet snippets.json Silence the "Comments are not permitted in JSON." error for the emmet snippets.json Jun 13, 2024
@robinmetral robinmetral changed the title Silence the "Comments are not permitted in JSON." error for the emmet snippets.json Silence the "Comments are not permitted in JSON." error for the emmet snippets.json to match parsing behavior Jun 13, 2024
@rzhao271 rzhao271 added bug Issue identified by VS Code Team member as probable bug emmet Emmet related issues confirmation-pending labels Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug confirmation-pending emmet Emmet related issues
Projects
None yet
Development

No branches or pull requests

2 participants