Trailing commas in profiles.schema.json breaks VS Code Intellisense #11373

Closed
opened 2026-01-31 02:45:55 +00:00 by claunia · 5 comments
Owner

Originally created by @xiiok on GitHub (Nov 12, 2020).

Environment

Windows build number: 10.0.20257.0
Windows Terminal version (if applicable): 1.5.3142.0

Any other software?
Visual Studio Code - Insiders: 1.52.0-insider

Steps to reproduce

Modify settings.json to use Terminal Preview 1.5 schema:

{
    "$schema": "https://raw.githubusercontent.com/microsoft/terminal/main/doc/cascadia/profiles.schema.json",

}

or (not preferred):

{
    "$schema": "https://raw.githubusercontent.com/microsoft/terminal/release-1.5/doc/cascadia/profiles.schema.json",

}

Expected behavior

VS Code Intellisense to parse the latest schema successfully and provide its features when modifying settings.json in a Terminal Preview installation.

It's worth noting that the unrelated warning below is present with all currently available versions of the schema and does not prevent Intellisense from functioning:

Draft 2019-09 schemas are not yet fully supported.

Actual behavior

VS Code Intellisense does not function in any capacity for settings.json when using the latest release-1.5 version of profiles.schema.json

Collected errors:

Trailing comma json(519) [697, 27]

Trailing comma json(519) [715, 27]

I've validated that removing the trailing commas on lines 697, 715 resolves the issue by modifying profiles.schema.json as such and saving it as profiles.schema.1.5.json in the same directory as settings.json. I updated my settings.json to:

{
    "$schema": "./profiles.schema.1.5.json",

}

and Intellisense now works as expected.

If I were to submit any PR for this it would be my first and I don't think it can get much simpler than this 😁

Originally created by @xiiok on GitHub (Nov 12, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: 10.0.20257.0 Windows Terminal version (if applicable): 1.5.3142.0 Any other software? Visual Studio Code - Insiders: 1.52.0-insider ``` # Steps to reproduce Modify settings.json to use Terminal Preview 1.5 schema: ``` { "$schema": "https://raw.githubusercontent.com/microsoft/terminal/main/doc/cascadia/profiles.schema.json", } ``` or (not preferred): ``` { "$schema": "https://raw.githubusercontent.com/microsoft/terminal/release-1.5/doc/cascadia/profiles.schema.json", } ``` # Expected behavior VS Code Intellisense to parse the latest schema successfully and provide its features when modifying `settings.json` in a Terminal Preview installation. It's worth noting that the unrelated warning below is present with all currently available versions of the schema and does not prevent Intellisense from functioning: > Draft 2019-09 schemas are not yet fully supported. # Actual behavior VS Code Intellisense does not function in any capacity for `settings.json` when using the latest release-1.5 version of `profiles.schema.json` Collected errors: > Trailing comma json(519) [697, 27] > Trailing comma json(519) [715, 27] I've validated that removing the trailing commas on lines 697, 715 resolves the issue by modifying `profiles.schema.json` as such and saving it as `profiles.schema.1.5.json` in the same directory as `settings.json`. I updated my `settings.json` to: ``` { "$schema": "./profiles.schema.1.5.json", } ``` and Intellisense now works as expected. If I were to submit any PR for this it would be my first and I don't think it can get much simpler than this 😁
Author
Owner

@Don-Vito commented on GitHub (Nov 12, 2020):

@slopra - I am not an owner or an expert, but I think this is a bug and it should be fixed since trailing commas are not supported by majority of parsers. If you already have a PR or close to it, I would suggest to push it for the team's review.

@Don-Vito commented on GitHub (Nov 12, 2020): @slopra - I am not an owner or an expert, but I think this is a bug and it should be fixed since trailing commas are not supported by majority of parsers. If you already have a PR or close to it, I would suggest to push it for the team's review.
Author
Owner

@zadjii-msft commented on GitHub (Nov 12, 2020):

Yea sure, go for it!

<sidebar>
I'll never understand strict JSON parsers. I thought that as an industry, the goal is to always have things that consume JSON accept the broadest set of possible input safely, but things that emit JSON should emit it as strictly as possible. Trailing commas seems like such a trivial thing to completely die on. I guess I'm not the kind of person to write JSON parsers 😄

@zadjii-msft commented on GitHub (Nov 12, 2020): Yea sure, go for it! \<sidebar> I'll never understand strict JSON parsers. I thought that as an industry, the goal is to always have things that consume JSON accept the broadest set of possible input safely, but things that emit JSON should emit it as strictly as possible. Trailing commas seems like such a trivial thing to _completely die on_. I guess I'm not the kind of person to write JSON parsers 😄
Author
Owner

@xiiok commented on GitHub (Nov 12, 2020):

Alright! Admittedly, reviewing the contribution process both in general and specific to this repo has more value to me personally than a functioning schema 😛. But I'm glad I came across something relatively simple and I'm excited to contribute!

On a theoretical level, I totally agree that at the very least it shouldn't be something to completely die on. On an implementation level? 🤷 lol
@xiiok commented on GitHub (Nov 12, 2020): Alright! Admittedly, reviewing the contribution process both in general and specific to this repo has more value to me personally than a functioning schema 😛. But I'm glad I came across something relatively simple and I'm excited to contribute! <sidebar> On a theoretical level, I totally agree that at the very least it shouldn't be something to completely die on. On an implementation level? 🤷 lol
Author
Owner

@PhMajerus commented on GitHub (Nov 13, 2020):

<sidebar>
@zadjii-msft
Visual Studio and VS Code are both generators and parsers, depending on how you look at it.
If you're authoring a JSON file to be consumed by the code you write, and the JSON library you're using is more strict than the editor you're using, you'll get no error or warning while authoring your file and a runtime failure when your app consumes your file.
This means the best behavior for a JSON editor in a development environment is strict, to make sure the file you create will work in any parser.

Having parsers that allow invalid files can be a problem as well if the file is used for data interchange. In the early days of the Web, most browsers tried to make sense of invalid HTML files, and the result was >90% of pages being invalid HTML and fail in some other browser, just because most developers were targetting the "good enough to display on my machine" instead of aiming for proper markup.

@PhMajerus commented on GitHub (Nov 13, 2020): \<sidebar\> @zadjii-msft Visual Studio and VS Code are both generators and parsers, depending on how you look at it. If you're authoring a JSON file to be consumed by the code you write, and the JSON library you're using is more strict than the editor you're using, you'll get no error or warning while authoring your file and a runtime failure when your app consumes your file. This means the best behavior for a JSON editor in a development environment is strict, to make sure the file you create will work in any parser. Having parsers that allow invalid files can be a problem as well if the file is used for data interchange. In the early days of the Web, most browsers tried to make sense of invalid HTML files, and the result was >90% of pages being invalid HTML and fail in some other browser, just because most developers were targetting the "good enough to display on my machine" instead of aiming for proper markup.
Author
Owner

@ghost commented on GitHub (Nov 20, 2020):

:tada:This issue was addressed in #8257, which has now been successfully released as Windows Terminal Preview v1.5.3242.0.🎉

Handy links:

@ghost commented on GitHub (Nov 20, 2020): :tada:This issue was addressed in #8257, which has now been successfully released as `Windows Terminal Preview v1.5.3242.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.5.3242.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#11373