Json Schema doesn't autocomplete when setting the color scheme in VS Code #7806

Closed
opened 2026-01-31 01:13:05 +00:00 by claunia · 11 comments
Owner

Originally created by @WSLUser on GitHub (Apr 29, 2020).

Environment

Windows build number: Microsoft Windows [Version 10.0.18363.778]
Windows Terminal version (if applicable): 0.11.1191.0

Any other software?
VS Code

Steps to reproduce

Open Settings from the About Page and see it launch in VS Code.
Define "colorScheme" to use a color scheme listed in defaults.json. Watch as Code refuses to do autocomplete for it.

Expected behavior

I expect the auto-complete to supply a list of color schemes listed in defaults.json that narrows as you start typing. For example, if the first letter I choose is "T", I'd expect all options that start with the letter T to appear in the helpful drop-down list (the newly added Tango schemes in this case.)

Actual behavior

You need to manually type it or copy/paste the name from defaults.json.

Originally created by @WSLUser on GitHub (Apr 29, 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: Microsoft Windows [Version 10.0.18363.778] Windows Terminal version (if applicable): 0.11.1191.0 Any other software? VS Code ``` # Steps to reproduce <!-- A description of how to trigger this bug. --> Open Settings from the About Page and see it launch in VS Code. Define `"colorScheme"` to use a color scheme listed in `defaults.json`. Watch as Code refuses to do autocomplete for it. # Expected behavior <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> I expect the auto-complete to supply a list of color schemes listed in` defaults.json` that narrows as you start typing. For example, if the first letter I choose is "T", I'd expect all options that start with the letter T to appear in the helpful drop-down list (the newly added Tango schemes in this case.) # Actual behavior <!-- What's actually happening? --> You need to manually type it or copy/paste the name from `defaults.json`.
Author
Owner

@zadjii-msft commented on GitHub (Apr 29, 2020):

This might be possible for the built-in themes, but I can't imagine that it would be possible to get this auto-complete behavior for schemes that the user has added

@zadjii-msft commented on GitHub (Apr 29, 2020): This _might_ be possible for the built-in themes, but I can't imagine that it would be possible to get this auto-complete behavior for schemes that the user has added
Author
Owner

@WSLUser commented on GitHub (Apr 29, 2020):

Yes, I'm thinking anything in defaults.json ought to be able to get IntelliSense. The user is on their own for any custom schemes.

@WSLUser commented on GitHub (Apr 29, 2020): Yes, I'm thinking anything in `defaults.json` ought to be able to get IntelliSense. The user is on their own for any custom schemes.
Author
Owner

@WSLUser commented on GitHub (Apr 29, 2020):

but I can't imagine that it would be possible to get this auto-complete behavior for schemes that the user has added

// Add custom color schemes to this array.
    // To learn more about color schemes, visit https://aka.ms/terminal-color-schemes
    "schemes": [],

Actually now that I think about it, before "colorScheme" is set, if "schemes": [] is configured, then we ought to be able to use what's defined there to allow "colorScheme": to get IntelliSense. VSCode does this when you write code that is intended to be re-used later on such as a variable. We should be able to take advantage of that.

@WSLUser commented on GitHub (Apr 29, 2020): > but I can't imagine that it would be possible to get this auto-complete behavior for schemes that the user has added ``` // Add custom color schemes to this array. // To learn more about color schemes, visit https://aka.ms/terminal-color-schemes "schemes": [], ``` Actually now that I think about it, before "colorScheme" is set, if `"schemes": []` is configured, then we ought to be able to use what's defined there to allow `"colorScheme":` to get IntelliSense. VSCode does this when you write code that is intended to be re-used later on such as a variable. We should be able to take advantage of that.
Author
Owner

@DHowett-MSFT commented on GitHub (Apr 29, 2020):

We would need an entire LanguageServer to get VSCode to suggest existing schemes. That’s just not something the schema can do, and it’s not something we’re likely to do. Great VSC extension idea!

@DHowett-MSFT commented on GitHub (Apr 29, 2020): We would need an entire LanguageServer to get VSCode to suggest existing schemes. That’s just not something the schema can do, and it’s not something we’re likely to do. Great VSC extension idea!
Author
Owner

@WSLUser commented on GitHub (Apr 29, 2020):

Probably there should be a way to get the TS/JS language server to help with json. Red Hat puts out a YAML extension though so it could go either way. I'll file a feature request on their side for it.

@WSLUser commented on GitHub (Apr 29, 2020): Probably there should be a way to get the TS/JS language server to help with json. Red Hat puts out a YAML extension though so it could go either way. I'll file a feature request on their side for it.
Author
Owner

@DHowett-MSFT commented on GitHub (Apr 29, 2020):

I mean, I think the JS/TS language servers do help with JSON, by way of the schema. Since there’s no schema-approved way to set dependent values and implement dynamic sets or say that you need to parse TWO json files instead of just the one, it’s just not something a generic language server or schema can do. It needs to be specific to the terminal settings format just so that it can actually give you contextual feedback.

@DHowett-MSFT commented on GitHub (Apr 29, 2020): I mean, I think the JS/TS language servers _do_ help with JSON, by way of the schema. Since there’s no schema-approved way to set dependent values and implement dynamic sets or say that you need to parse TWO json files instead of just the one, it’s just not something a generic language server or schema can _do_. It needs to be specific to the terminal settings format just so that it can actually give you contextual feedback.
Author
Owner

@WSLUser commented on GitHub (Apr 29, 2020):

I think it's reasonable to only be able to parse through settings.json. If users create a separate json for settings, probably via extension, it would be on the extension to ensure the schema registers that json instead of the regular settings.json (It really ought to just overwrite the original and ensure it stays synced to any changes made to settings.json.

@WSLUser commented on GitHub (Apr 29, 2020): I think it's reasonable to only be able to parse through settings.json. If users create a separate json for settings, probably via extension, it would be on the extension to ensure the schema registers that json instead of the regular `settings.json` (It really ought to just overwrite the original and ensure it stays synced to any changes made to `settings.json`.
Author
Owner

@WSLUser commented on GitHub (Apr 29, 2020):

You can always add jq as a dep for json parsing. That is exactly what it's intended to do and it does it well (and it's available for Windows, not just Linux unlike sed, awk, gawk, etc.)

@WSLUser commented on GitHub (Apr 29, 2020): You can always add `jq` as a dep for json parsing. That is exactly what it's intended to do and it does it well (and it's available for Windows, not just Linux unlike `sed`, `awk`, `gawk`, etc.)
Author
Owner

@DHowett-MSFT commented on GitHub (Apr 29, 2020):

Sorry, it’s just not terminal’s job. This is really good stuff to capture for VSC though

@DHowett-MSFT commented on GitHub (Apr 29, 2020): Sorry, it’s just not terminal’s job. This is really good stuff to capture for VSC though
Author
Owner

@WSLUser commented on GitHub (Apr 29, 2020):

The action still here is reading the schemes from default.json. The schema can do that.

@WSLUser commented on GitHub (Apr 29, 2020): The action still here is reading the schemes from `default.json`. The schema can do that.
Author
Owner

@vmiheer commented on GitHub (Jun 15, 2023):

The schema causes warning (Incorrect type String expected) when using (valid):

              "colorScheme": { "light": "Solarized Light", "dark": "Solarized Dark" },

Not sure if it's already fixed.

@vmiheer commented on GitHub (Jun 15, 2023): The schema causes warning (Incorrect type String expected) when using (valid): ```json "colorScheme": { "light": "Solarized Light", "dark": "Solarized Dark" }, ``` Not sure if it's already fixed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7806