Repository: vscode
Issue: [json] Schema changes not reflected if schema file has jsonc extension.
Labels: bug,json

Type: <b>Bug</b>

1. Create a JSON Schema file (schema file) with the json extension and the following contents.

```
{
    "$schema": "http://json-schema.org/draft-07/schema",
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "$schema": {
          "type": "string"
        },
        "test": {"type": "boolean"}
    }
}
```

2. Create a second file (instance file) in the same folder with the json extension and the  following contents.

```
{
    "$schema": "http://json-schema.org/draft-07/schema",
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "$schema": {
          "type": "string"
        },
        "test": {"type": "boolean"}
    }
}
```

3. Note that there are no problems in the instance file.
4. Change the name of the property in the schema file from test to test1 and save.
5. Note that there is now a problem in the instance file without having to reload Visual Studio Code.

_"Property test is not allowed."_

6. Change the extension of the schema file and the reference to it in the instance file to json (instead of jsonc).
7. Change the name of the property in the schema file from test1 back to test.
8. Note that the problem in the instance file remains.

_"Property test1 is not allowed."_

9. Restart Visual Studio Code.
10. Note that there are no longer any problems in the instance file.

Visual Studio Code does appear to support JSON Schemas with the jsonc extension just like it does those with a json extension. Unlike schema files with the json extension though, those with the jsonc extension require a restart of Visual Studio Code to have changes relected in the validation of instance documents.

Note that this workaround also resulted in the schema changes being reflected.

https://stackoverflow.com/a/70175188/81595

VS Code version: Code 1.79.0 (b380da4ef1ee00e224a15c1d4d9793e27c2b6302, 2023-06-07T14:26:35.552Z)
OS version: Windows_NT x64 10.0.19045
Modes:

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (8 x 3592)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: disabled_off<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>video_decode: enabled<br>video_encode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: enabled|
|Load (avg)|undefined|
|Memory (System)|31.95GB (11.72GB free)|
|Process Argv|--crash-reporter-id 38b672a9-64ca-40e9-8060-3a52ff823ee1|
|Screen Reader|no|
|VM|0%|
</details><details><summary>Extensions (20)</summary>

Extension|Author (truncated)|Version
---|---|---
ng-template|Ang|16.0.0
argutec-azure-repos|arg|1.2007.15
vscode-eslint|dba|2.4.0
githistory|don|0.6.20
xml|Dot|2.5.1
prettier-vscode|esb|9.13.0
vscode-tfs|gen|2.0.0
gitpod-desktop|git|0.0.123
json-escaper|jos|1.1.2
rainbow-csv|mec|3.7.0
vscode-docker|ms-|1.25.1
csharp|ms-|1.25.9
remote-containers|ms-|0.295.0
remote-ssh|ms-|0.102.0
remote-ssh-edit|ms-|0.86.0
remote-wsl|ms-|0.79.4
powershell|ms-|2023.6.0
remote-explorer|ms-|0.4.0
copy-json-path|nid|0.3.0
LiveServer|rit|5.7.9


</details><details>
<summary>A/B Experiments</summary>

```
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes516:30244333
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscoreces:30445986
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593cf:30376535
pythonvs932:30410667
cppdebug:30492333
vsclangdf:30486550
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
vscccc:30610679
282f8724:30602487
pyind779:30671433
89544117:30613380
pythonsymbol12:30671437
showlangstatbar:30737416
vsctsb:30748421
pythonms35:30701012
03d35959:30757346
pythonfmttext:30731395
pythoncmvfstrcf:30756944
fixhidewlkth:30730051
showsbindicator:30760979
pythongtdpathcf:30739705
dh2dc718:30763024

```

</details>

<!-- generated by issue reporter -->