Describe the bug
In a multi-root workspace, there's a schema
def/bla_schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"bla": {
"type": "array",
"items": {
"type": "string",
"enum": ["foo", "bar", "fla"]
}
}
},
"required": ["bla"],
"additionalProperties": false
}
In another project there's a file
use/bla.json
# yaml-language-server: $schema=def/bla_schema.json
bla:
- foo
- bar
- fla
- foo
Even though README says that paths are resolved wrt multi-project roots, validating just errors out.
Now trying a relative path over workspace roots:
# yaml-language-server: $schema=../def/bla_schema.json
Expected result
Path is resolved to <prefix>/use/../def/bla_schema.json and autocompletion is working.
Actual result
Path is resolved to <prefix>/use/def/bla_schema.json, thus yielding an invalid location. Obviously, autocompletion does not work.
Unable to load schema from '<prefix>/use/def/bla_schema.json': No content.YAML(768)
Proposed solution
Either
- support paths relative to workspace roots, or
- retain
.. parts in modeline.
Environment
Describe the bug
In a multi-root workspace, there's a schema
def/bla_schema.json{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "bla": { "type": "array", "items": { "type": "string", "enum": ["foo", "bar", "fla"] } } }, "required": ["bla"], "additionalProperties": false }In another project there's a file
use/bla.jsonEven though
READMEsays that paths are resolved wrt multi-project roots, validating just errors out.Now trying a relative path over workspace roots:
# yaml-language-server: $schema=../def/bla_schema.jsonExpected result
Path is resolved to
<prefix>/use/../def/bla_schema.jsonand autocompletion is working.Actual result
Path is resolved to
<prefix>/use/def/bla_schema.json, thus yielding an invalid location. Obviously, autocompletion does not work.Unable to load schema from '<prefix>/use/def/bla_schema.json': No content.YAML(768)
Proposed solution
Either
..parts in modeline.Environment