microsoft / vscode-json-languageservice

JSON language service extracted from VSCode to be reused, e.g in the Monaco editor.
Other
261 stars 110 forks source link

Regression: Problems loading reference schemaservice #206

Open mehdigmira opened 1 year ago

mehdigmira commented 1 year ago

Hello,

I Think there as been a recent regression. I'm using VScode 1.82.2 (Universal). I have a devcontainer with a root folder named /code and the following config:

"json.schemas": [
    {
        "fileMatch": [
            "/code/path/inside/my/code/**/*.json"
        ],
        "url": "/code/environment.schema.json"
    }
],

/code/environment.schema.json exists. And VScode even seems to partially work when opening up a json file: autocomplete as well as field descriptions are displayed. However errors are not underline and the following message is siplayed

Problems loading reference 'schemaservice://combinedschema/untitled:environment.schema.json': Unable to load schema from 'schemaservice://combinedschema/untitled:environment.schema.json': cannot open schemaservice://combinedschema/untitled%3Aenvironment.schema.json. Detail: Unable to resolve resource schemaservice://combinedschema/untitled%3Aenvironment.schema.json.(768)

Note that when filling "$schema": "/code/environment.schema.json" inside a json file, the message disappears. and everything works well.

I'm pretty sure this same configuration used to work seamlessly and that this was introduces in a recent update of Vscode.