Skip to content

settings.json parsing fails on the IDE2 backend if settings.json has comments #1945

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

Closed
3 tasks done
kittaakos opened this issue Mar 9, 2023 · 0 comments · Fixed by #1948
Closed
3 tasks done

settings.json parsing fails on the IDE2 backend if settings.json has comments #1945

kittaakos opened this issue Mar 9, 2023 · 0 comments · Fixed by #1948
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@kittaakos
Copy link
Contributor

Describe the problem

VS Code, Theia, and IDE2 use a relaxed version of JSON for storing the settings in the settings.json file: https://code.visualstudio.com/Docs/languages/json#_json-with-comments

If I have the following settings.json content, it is entirely valid but does not work on the IDE2's backend:

JSONC:

{
  // "arduino.cli.daemon.debug": false
  // it's a valid jsonc
}

VS.

JSON:

{
  // "arduino.cli.daemon.debug": false
  // it's an invalid json
}

To reproduce

There are multiple silent problems, but here is a user-facing bug:

  • Enable arduino.sketch.inoBlueprint and verify that it works:| when you create a new sketch, your preferred default .ino content is used for the new sketch.
  • Open the settings.json and command out any other preference with //.
  • Restart IDE2 and create a new sketch. IDE2 creates the new sketch with the default content, not the user-defined one.

Expected behavior

  • IDE2 backend can handle JSONC in settings.json, not only JSON.
  • The suboptimal setting parsing on the IDE2 backend is single-sourced.

Arduino IDE version

2.0.4

Operating system

macOS

Operating system version

12.6.3

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@kittaakos kittaakos added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Mar 9, 2023
kittaakos pushed a commit that referenced this issue Mar 10, 2023
Occurred when `settings.json` contained comments or a trailing comma.

Closes #1945

Signed-off-by: Akos Kitta <[email protected]>
kittaakos pushed a commit that referenced this issue Mar 10, 2023
Occurred when `settings.json` contained comments or a trailing comma.

Closes #1945

Signed-off-by: Akos Kitta <[email protected]>
kittaakos pushed a commit that referenced this issue Mar 10, 2023
Occurred when `settings.json` contained comments or a trailing comma.

Closes #1945

Signed-off-by: Akos Kitta <[email protected]>
@kittaakos kittaakos self-assigned this Mar 10, 2023
kittaakos pushed a commit that referenced this issue Mar 13, 2023
Occurred when `settings.json` contained comments or a trailing comma.

Closes #1945

Signed-off-by: Akos Kitta <[email protected]>
@per1234 per1234 added the conclusion: resolved Issue was resolved label Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants