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
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",
}
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.
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 馃榿
@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.
Yea sure, go for it!
\
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 馃槃
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
\
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.
:tada:This issue was addressed in #8257, which has now been successfully released as Windows Terminal Preview v1.5.3242.0.:tada:
Handy links: