Change:
* A match succeeds when there is at least one pattern matching and last matching pattern does not start with '!'. */ fileMatch: string[]; <ins> /** * If provided, the association is only used if the validated document is located in the given folder (directly or indirectly) */ folderUri?: string; </ins> /* * The schema for the given URI. * If no schema is provided, the schema will be fetched with the schema request service (if available).

Discussion:
Type: <bBug</bWhen attempting to exclude files from a generic *.json schema, VSCode doesn't seem to recognize that, and apply it anyway. VS Code version: Code 1.73.1 (, 2022-11-09T04:27:29.066Z) OS version: WindowsNT x64 10.0. Modes: Sandboxed: No Remote OS version: Linux arm64 5.15.0-1021-oracle <details<summarySystem Info</summary </details<details<summaryExtensions (33)</summaryExtensionVersion ------ 5et-homebrew-helper0.3.1 vscode-todo-highlight2.0.4 vscord5.0.10 dotenv1.0.1 jupyter-keymap1.0.0 remote-ssh0.92.0 remote-ssh-edit0.84.0 remote-explorer0.0.2 5e-syntax0.1.0 vscode-icons12.0.1 unity-snippets0.1.2 go-to-character-position2.0.0 vscode-eslint2.2.6 git-project-manager1.8.2 vscode-npm3.3.0 sort-json-array3.1.0 copilot1.61.7372 git-graph1.30.0 isort2022.8.0 python2022.18.2 vscode-pylance2022.11.30 jupyter2022.9. jupyter-keymap1.0.0 jupyter-renderers1.0.12 vscode-jupyter-cell-tags0.1.6 vscode-jupyter-slideshow0.1.5 vscode-json-editor0.3.0 vscode-yaml1.10.1 svelte-vscode106.2.0 pdf1.2.0 intellicode-api-usage-examples0.2.6 vscodeintellicode1.2.29 json2.0.2 (1 theme extensions excluded) </details<details<summaryA/B Experiments</summary</details<!-- generated by issue reporter --
For example, this: Still tries to validate files and all files in the folder. The first schema that applies only to the folder is also, simultaneously applied with the others, while it should be the only one. is also under this effect.
Ok, I see the bug.

It's because of , where we merge the schema associations
Also affecting myself
The workaround is not use two file associations for the same schema. Just write:
This unfortunately simply breaks the validation. The two fileMatches are required for VSCode to detect the files. Not sure why doesn't catch everything.
To elaborate https://user-

<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: Yes <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --- VS Code Version: 1.66.2 (Tested in Insiders 1.67.0 with same results) OS Version: Windows 10 Education N x64 - 21H1 Steps to Reproduce: a Workspace and add a simple folder with a schema for JSON files defined in the folder settings. ! <details<summaryschema-</summary</detailsthat the file is being validated correctly. ! a second folder to the workspace. In my test I an empty folder in the same root as the workspace. The validation still works as expected. the window or close/open VSCode. The schema validation has stopped working as if the file did not match the in the folder settings. Removing the second folder and reloading makes it work again. ! As a note, if you open directly in VSCode rather than the workspace, the validation works as expected.
The new validated by schema information is great. But this reported issue in work spaces prevents me from upgrading from 1.65. Any chance this will be addressed anytime soon?
Is it working correctly pre-1.65? Because this issue is very annoying here (we have to open multiple instances of vscode as workaround which is problematic for various reasons), and we could very much just ship a portable version of previous version of vscode
Yes it worked before. So you should be good with an old release for the time being. Not a solution but at least workspaces are usable.
Update: Not fixed.

Just tried in 1.73-insiders and still happening
Still have the bug on 1.71 on my machine. Top: Workspace, Bottom: Folder !
Still have the bug on 1.71.2
I'm on 1.73 and this is still an issue. Works ok when you open a folder and the json.schemas is at the root of it inside .vscode folder. It doesn't work in a multi-root workspace. We have a lot of JSON files and autocomplete doesn't work anymore. This used to work before. Surprised as to why this is not getting any traction. Seems like a huge regression in functionality.
I noticed this is OS-specific too. On ubuntu 22 machine multi-root validation works fine but on windows 10 machine it doesn't, on the same codebase.
Yeah, this is probably the reason I tricked myself it was working back then. , any status update on this? I am pinging, because there has been no update on the matter since its original report in April, and the issue is 100% reproducible on any vscode version since 1.65
Can confirm this observation, the issue only occurs in windows and not on Ubuntu, have not tested macOS
Same here using Remote-SSH to an Ubuntu workspace.
Same here using Remote-SSH to a Redhat workspace. However, it works right setting the "$schema": "url-schema" attribute in the .json file.

<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: Yes <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --- VS Code Version: 1.63.2 OS Version: macOS Monterey 12.1 (21C52) Steps to Reproduce: Create a jsonc file with trailing commas that vscode problems view hates them issue the following in vscode settings view still hates them, it seems to have no effect. Did something change since then? Is there another way to get VSCode to ignore trailing commas as a problem in the problems view?
I tried and it still works for me. That's with 1.64-insiders, but I also tested with 1.63 !
Hmm, what am I doing wrong? ~/Library/Application !
Is this in a multi-root workspace?
No, actually I see now that it seems to only reproduce on jsonc files opened that reside outside of the workspace. If it's in the user-level setting, I would have guessed that it should apply to any opened file, no?
It's with multi-folder workspaces and an external file
Thank you! This will be in next month's 1.76, right? i.e not the version released today:
Yes 1.76

Issue Type: <bBug</bI have a multi-root VSC workspace with three folders: A/ ./subfolderOfA In A/, there is a file and in there, there are the following settings: When I edit some file somewhere inside A/, it seems like this JSON schema file path is only properly resolved If I remove folders and from my multi-root workspace. Shouldn't this work? VS Code version: Code 1.56.2 (, 2021-05-12T17:13:13.157Z) OS version: WindowsNT x64 10.0. <details<summarySystem Info</summary </details<details<summaryExtensions (10)</summaryExtensionVersion ------ bracket-pair-colorizer-20.2.0 xml2.5.1 tortoise-svn0.1.1 python2020.9. vscode-pylance2021.5.3 jupyter2021.6. cpptools1.3.1 code-spell-checker1.10.2 open-in-browser2.0.0 vscodeintellicode1.2.14 </details<details<summaryA/B Experiments</summary</details<!-- generated by issue reporter --
Hi Unfortunately, I am not familiar with your planning process but I wanted to ask if this bug will be solved in the near future?
Sorry, I don't know when I will find time for looking at this.
It's honestly quite a shame that this feature is missing. Unless you want to modify the json file structure to include the "$schema" property you are stuck having to open the given sub-folders directly which is a significant detrement to the DX when working in multi-root workspaces.
Hi Sorry to pick this up again but, according to the motto "New Year, New Luck", is there a chance to have this and fixed soon?
It seems like relative schema path resolution does not work on Windows, even when not in a multi-root workspace. Schemas always try to resolve in rather than the workspace folder. !
Note: relative path can not be used in user settings. But they should work in workspace files, where I could reproduce the problem, thanks !
Now on macOS, unfortunately it seems like json.schemas in the workspace settings are ignored.

<img width="1605" alt="image" src="https://user-"Changing to something invalid does not result in any diagnostics being reported, either. However if I move into my user settings and change the schema path to be absolute, it works.
Now I get in the Problems view with the following setup: In a non-multi-root workspace:
I created a separate issue to investigate as the error comes from to the empty which is unrelated. If you remove the you should see that the - schema is used
To verify: clone open workspace look at the workspace settings: all files are associated with schema . Note that this is a relative path to the workspace file open both files and check that code completion gives back property . You can also click on the JSON language selector ( next to JSON in the status bar) to see the schema that is associated look at the folder setings: is associated with schema . Note that this is a relative path to the folder open both files files and check that code completion gives back property , but only when in folder1. You can also click on the JSON language selector ( next to JSON in the status bar) to see the schema that is associated
I tried to verify this using build but the schemas are not used. Here is what I see in the UI: <img width="706" alt="image" src="https://user-" please advise which build I should use for verification.
Looks like it is still not working on Windows due to to an URI encoding issue.
I tested as described in with VS Code 1.76.0 on Windows. I observed the following for and in VS Code: no schema-defined code completion is offered there is no schema offered when clicking on the language selector I then tested folder-only settings by opening VS Code to . I observed the same as above for . FWIW, describes another repro with only folder settings (not workspace settings). Is there a known workaround to get validation working using on Windows for 1.76.0?
the fix for Windows is coming:
is now also fixed (and verified)