Repository navigation
Closed
Closed
Copy link
Labels
Milestone
Description
Issue Type: Bug
I have a multi-root VSC workspace with three folders:
- A/
- ./subfolderOfA
<external abs path>
In A/, there is a .code-workspace file and in there, there are the following settings:
"files.associations": {
"*.rq*": "json"
},
"json.schemas": [
{
"fileMatch": [
"*.rqw"
],
"url": "./samples/schemas/rqwSchema.json"
}
]
When I edit some .rqx file somewhere inside A/, it seems like this JSON schema file path is only properly resolved If I remove folders ./subfolderOfA and <external abs path> from my multi-root workspace. Shouldn't this work?
VS Code version: Code 1.56.2 (054a929, 2021-05-12T17:13:13.157Z)
OS version: Windows_NT x64 10.0.19042
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz (8 x 2712) |
| GPU Status | 2d_canvas: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on oop_rasterization: enabled opengl: enabled_on rasterization: enabled skia_renderer: enabled_on video_decode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled |
| Load (avg) | undefined |
| Memory (System) | 15.92GB (8.65GB free) |
| Process Argv | --crash-reporter-id 919e0ed9-46f3-4ad4-9e28-f35755bf8266 |
| Screen Reader | no |
| VM | 0% |
Extensions (10)
| Extension | Author (truncated) | Version |
|---|---|---|
| bracket-pair-colorizer-2 | Coe | 0.2.0 |
| xml | Dot | 2.5.1 |
| tortoise-svn | fan | 0.1.1 |
| python | ms- | 2020.9.114305 |
| vscode-pylance | ms- | 2021.5.3 |
| jupyter | ms- | 2021.6.832593372 |
| cpptools | ms- | 1.3.1 |
| code-spell-checker | str | 1.10.2 |
| open-in-browser | tec | 2.0.0 |
| vscodeintellicode | Vis | 1.2.14 |
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
pythonvspyt602:30300191
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
pythonvspyt639:30300192
pythontb:30283811
pythonvspyt551:30291414
vspre833cf:30267465
pythonptprofiler:30281270
vshan820:30294714
vscorecescf:30290706
pythondataviewer:30285071
vscus158cf:30286554
vscgsv2:30301612
vscorehov:30302759
bridgeflight:30302069
vscod805:30301674
Reacted by Enteleform, Lyra [he/him], Xavier Artusi, Darkin and Juan Ferrer
Activity
[-]JSON schema path not resolved properly for multi-root workspaces[/-][+][json] schema path not resolved properly for multi-root workspaces[/+]41 remaining items
aeschli commentedon Feb 28, 2023
To verify:
test-schema-in-workspace/test-schema.code-workspacews.jsonare associated with schema./folder2/ws-schema.json. Note that this is a relative path to the workspace filews.jsonand check that code completion gives back propertyws-folder2. You can also click on the JSON language selector ({ }next to JSON in the status bar) to see the schema that is associatedfoo.jsonis associated with schema./folder1/foo-schema.json. Note that this is a relative path to the folderfoo.jsonfiles and check that code completion gives back propertyfoo-folder1, 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 associateddbaeumer commentedon Feb 28, 2023
I tried to verify this using build
but the schemas are not used. Here is what I see in the UI:
Martin Aeschlimann (@aeschli) please advise which build I should use for verification.
aeschli commentedon Feb 28, 2023
Looks like it is still not working on Windows due to to an URI encoding issue.
alx9r commentedon Mar 7, 2023
I tested as described in the "test-schema-in-workspace" repro with VS Code 1.76.0 on Windows.
I observed the following for
foo.jsonandbar.jsonin VS Code:I then tested folder-only settings by opening VS Code to
folder1. I observed the same as above forfoo.json.FWIW, this stackoverflow question describes another repro with only folder settings (not workspace settings).
Is there a known workaround to get validation working using
fileMatchon Windows for 1.76.0?aeschli commentedon Mar 8, 2023
alx9r the fix for Windows is coming: #176296
aeschli commentedon Mar 20, 2023
#176296 is now also fixed (and verified)