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

warning: matches multiple schemas when only one must validate #86738

Closed
carpet92 opened this issue Dec 11, 2019 · 6 comments
Closed

warning: matches multiple schemas when only one must validate #86738

carpet92 opened this issue Dec 11, 2019 · 6 comments
Labels
*caused-by-extension Issue identified to be caused by an extension terminal Integrated terminal issues

Comments

@carpet92
Copy link

carpet92 commented Dec 11, 2019

I use VSCode to edit profiles.json settings file for Windows Terminal.

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 in status bar:

{
	"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:

WARNING

Is there something wrong with my profiles.json? Or it's just bug?

Related issue in WT repo: microsoft/terminal#3909

@vscodebot vscodebot bot added the terminal Integrated terminal issues label Dec 11, 2019
@RMacfarlane RMacfarlane added the *caused-by-extension Issue identified to be caused by an extension label Dec 11, 2019
@vscodebot
Copy link

vscodebot bot commented Dec 11, 2019

This issue is caused by an extension, please file it with the repository (or contact) the extension has linked in its overview in VS Code or the marketplace for VS Code. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Dec 11, 2019
@RMacfarlane
Copy link
Contributor

@Zx-EvM I'm unable to find the string "Matches multiple schemas when only one must validate." in the VSCode code base, so I believe this diagnostic is coming from an extension.

@carpet92
Copy link
Author

@RMacfarlane issue reproduced with all extensions disabled

@IllusionMH
Copy link
Contributor

@RMacfarlane I can repro this issue with latest insider and all extensions disabled.

VS Code version: Code - Insiders 1.42.0-insider (cbeff45, 2019-12-13T07:08:57.560Z)
OS version: Windows_NT x64 10.0.18362

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz (12 x 3192)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_renderer: disabled_off
surface_control: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.72GB (17.04GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (24)
Extension Author (truncated) Version
markdown-toc Ala 1.5.6
vscode-css-modules and 1.1.4
markdown-preview-github-styles bie 0.1.6
vscode-css-modules cli 0.2.3
bracket-pair-colorizer-2 Coe 0.0.29
gitlens eam 10.2.0
remotehub eam 0.5.0
toggle-excluded-files eam 1.7.0
EditorConfig Edi 0.14.3
LogFileHighlighter emi 2.6.0
vscode-pull-request-github-insiders Git 2019.12.15362
vscode-test-explorer hbe 2.15.0
rest-client hum 0.23.0
vscode-peacock joh 3.2.0
code-fragments mar 1.2.0
remote-wsl ms- 0.41.5
debugger-for-chrome msj 4.12.3
debugger-for-edge msj 1.0.13
material-icon-theme PKi 3.9.2
copy-relative-path-posix rss 0.0.4
vscode-jest-test-adapter rtb 0.2.0
code-settings-sync Sha 3.4.3
quokka-vscode Wal 1.0.265
markdown-pdf yza 1.4.1

Most likely this issue came from JSON Schema validator (might be earlier bundled with monaco monaco).

However other cases in the internet were caused by problems with schema and fixes there. Will try to check if Windows Terminal has problems with linked schema

@carpet92
Copy link
Author

@RMacfarlane reopen issue maybe?

@IllusionMH
Copy link
Contributor

IllusionMH commented Dec 23, 2019

@Zx-EvM no reason to open this issue because problem is with schema

Linked schema is "$schema": "https://aka.ms/terminal-profiles-schema".
Can be fixed by adding "type": "object" to ProfilesObject definition.

UPD. Submitted PR to fix the schema microsoft/terminal#4045

zadjii-msft pushed a commit to microsoft/terminal 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
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*caused-by-extension Issue identified to be caused by an extension terminal Integrated terminal issues
Projects
None yet
Development

No branches or pull requests

3 participants