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

vscode warning: matches multiple schemas when only one must validate #3909

Closed
carpet92 opened this issue Dec 11, 2019 · 1 comment · Fixed by #4045
Closed

vscode warning: matches multiple schemas when only one must validate #3909

carpet92 opened this issue Dec 11, 2019 · 1 comment · Fixed by #4045
Labels
Area-Schema Things that have to do with the json schema. Area-Settings Issues related to settings and customizability, for console or terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-2 A description (P2) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@carpet92
Copy link

I use VSCode to edit profiles.json settings file.

My config looks this:

// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
// https://github.com/microsoft/terminal/blob/master/doc/cascadia/SettingsSchema.md

{
    "$schema": "https://aka.ms/terminal-profiles-schema",

    "defaultProfile": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",

    "initialCols": 120,
    "initialRows": 30,

    "requestedTheme": "system",

    "profiles":
    [
        {
            // Make changes here to the powershell.exe profile
            "useAcrylic": true,
            "acrylicOpacity": 0.5,
            "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
            "name": "Windows PowerShell 6",
            "commandline": "C:\\Program Files\\PowerShell\\6\\pwsh.exe",
            "colorScheme": "Solarized Dark cmd-colors",
            "padding": "20, 10, 20, 20",
            "fontFace": "Cascadia Code",
            "fontSize": 12,
            "cursorShape": "filledBox",
            "hidden": false
        },
        {
            // Make changes here to the cmd.exe profile
            "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
            "name": "cmd",
            "commandline": "cmd.exe",
            "hidden": false
        },
        {
            "useAcrylic": true,
            "acrylicOpacity": 0.5,
            "guid": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
            "hidden": false,
            "name": "🤘 Ubuntu-18.04",
            "commandline": "wsl -d Ubuntu-18.04",
            "snapOnInput" : false, // scroll back to the command input line when typing
            "cursorColor": "#FFFFFF",
            "colorScheme": "UbuntuLegit",
            "source": "Windows.Terminal.Wsl",
            "padding": "20, 10, 20, 20",
            "fontFace": "Cascadia Code",
            "fontSize": 12,
            "cursorShape": "filledBox"
        },
        {
            "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
            "hidden": true,
            "name": "Azure Cloud Shell",
            "source": "Windows.Terminal.Azure"
        },
        {
            "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
            "hidden": true,
            "name": "PowerShell Core",
            "source": "Windows.Terminal.PowershellCore"
        }
    ],

    // Add custom color schemes to this array
    "schemes": [{
        "background" : "#002B36",
        "black" : "#073642",
        "blue" : "#268BD2",
        "brightBlack" : "#002B36",
        "brightBlue" : "#839496",
        "brightCyan" : "#93A1A1",
        "brightGreen" : "#586E75",
        "brightPurple" : "#6C71C4",
        "brightRed" : "#CB4B16",
        "brightWhite" : "#FDF6E3",
        "brightYellow" : "#657B83",
        "cyan" : "#2AA198",
        "foreground" : "#839496",
        "green" : "#859900",
        "name" : "Solarized Dark",
        "purple" : "#D33682",
        "red" : "#DC322F",
        "white" : "#EEE8D5",
        "yellow" : "#B58900"
    },
    {
        "background": "#002B36",
        "brightBlack": "#073642",
        "brightBlue": "#268BD2",
        "black": "#002B36",
        "blue": "#839496",
        "cyan": "#93A1A1",
        "green": "#586E75",
        "purple": "#6C71C4",
        "red": "#CB4B16",
        "white": "#FDF6E3",
        "yellow": "#657B83",
        "brightCyan": "#2AA198",
        "foreground": "#839496",
        "brightGreen": "#859900",
        "name": "Solarized Dark cmd-colors",
        "brightPurple": "#D33682",
        "brightRed": "#DC322F",
        "brightWhite": "#EEE8D5",
        "brightYellow": "#B58900"
    },
    {
        "background" : "#FDF6E3",
        "black" : "#073642",
        "blue" : "#268BD2",
        "brightBlack" : "#002B36",
        "brightBlue" : "#839496",
        "brightCyan" : "#93A1A1",
        "brightGreen" : "#586E75",
        "brightPurple" : "#6C71C4",
        "brightRed" : "#CB4B16",
        "brightWhite" : "#FDF6E3",
        "brightYellow" : "#657B83",
        "cyan" : "#2AA198",
        "foreground" : "#073642",
        "green" : "#859900",
        "name" : "Solarized Light",
        "purple" : "#D33682",
        "red" : "#D30102",
        "white" : "#EEE8D5",
        "yellow" : "#B58900"
    },
    {
        "background" : "#2C001E",
        "black" : "#4E9A06",
        "blue" : "#3465A4",
        "brightBlack" : "#555753",
        "brightBlue" : "#729FCF",
        "brightCyan" : "#34E2E2",
        "brightGreen" : "#8AE234",
        "brightPurple" : "#AD7FA8",
        "brightRed" : "#EF2929",
        "brightWhite" : "#EEEEEE",
        "brightYellow" : "#FCE94F",
        "cyan" : "#06989A",
        "foreground" : "#EEEEEE",
        "green" : "#300A24",
        "name" : "UbuntuLegit",
        "purple" : "#75507B",
        "red" : "#CC0000",
        "white" : "#D3D7CF",
        "yellow" : "#C4A000"
    }],

    // Add any keybinding overrides to this array.
    // To unbind a default keybinding, set the command to "unbound"
    "keybindings": []
}

I noticed that VSCode shows warning:

{
	"resource": "/c:/Users/User/AppData/Local/Packages/Microsoft.WindowsTerminal_8wekyb3d8bbwe/LocalState/profiles.json",
	"owner": "_generated_diagnostic_collection_name_#0",
	"severity": 4,
	"message": "Matches multiple schemas when only one must validate.",
	"startLineNumber": 17,
	"startColumn": 5,
	"endLineNumber": 17,
	"endColumn": 6
}

Screenshot:

Screenshot (363)

Is there something wrong with my profiles.json?

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Dec 11, 2019
@zadjii-msft
Copy link
Member

There's probably nothing wrong here - I probably just botched the schema update in #3892. I thought that was the right way of defining that, but I guess the schema validator I used wasn't as strict as VsCode.

@zadjii-msft zadjii-msft added Area-Schema Things that have to do with the json schema. Area-Settings Issues related to settings and customizability, for console or terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Terminal The new Windows Terminal. labels Dec 11, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Dec 11, 2019
@zadjii-msft zadjii-msft added this to the Terminal v1.0 milestone Dec 11, 2019
@zadjii-msft zadjii-msft added the Help Wanted We encourage anyone to jump in on these. label Dec 11, 2019
@DHowett-MSFT DHowett-MSFT removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Dec 12, 2019
@ghost ghost added the In-PR This issue has a related PR label Dec 23, 2019
@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed Help Wanted We encourage anyone to jump in on these. In-PR This issue has a related PR labels Dec 30, 2019
zadjii-msft pushed a commit that referenced this issue Dec 30, 2019
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? -->
## Summary of the Pull Request
Adds proper `type` for `ProfilesObject` definition to avoid warnings about matches of multiple schemas.

<!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> 
## References
Original issue: #3909
Related PR: #3892
Relates VSCode issue: microsoft/vscode#86738

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [X] Closes #3909
* [X] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [ ] No new tests ~Tests added/passed~
* [ ] No docs update needed ~Requires documentation to be updated~
* [X] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #3909 (marked as help wanted)

<!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments

<!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
1. Download `doc/cascadia/profiles.schema.json` locally
1. Open `profiles.json` from WT in VSCode
1. Replace `$schema` value with path to local copy (verified that all errors are still in place and validations works as before)
1. Update it with `type` on `ProfilesObject`
1. Check that `Matches multiple schemas when only one must validate` warning is fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Schema Things that have to do with the json schema. Area-Settings Issues related to settings and customizability, for console or terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-2 A description (P2) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants