yaml-language-server
yaml-language-server copied to clipboard
YAML `---` for "Multiple documents within a single stream" doesn't work [YAML Language Server]
[Originally reported as https://github.com/redhat-developer/vscode-yaml/issues/995, before I understood this really belongs more here.]
I wrote my first trivial JSON schema enola.schema.jsonc, like this:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://docs.enola.dev/json-schema/enola_meta.schema.jsonc",
"title": "Enola.dev Meta Model",
"description": "See https://docs.enola.dev",
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"description": "Short technical name of this Type."
}
},
"required": ["name"]
}
Then I wrote an test.yaml file using that schema, like this:
# yaml-language-server: $schema=enola.schema.jsonc
name: enola.dev/url
doc: enola.md#URL
---
name: enola.dev/id
doc: enola.md#ID
Current Behavior
It does put a "red squiggle" on the first doc: enola.md#URL but not on the second doc: enola.md#ID.
In fact the 2nd name: enola.dev/id doesn't have the "hover" with the descriptionfrom the schema either.
It looks like the YAML --- syntax for "multiple documents within a single stream" isn't supported / doesn't work?
Expected Behavior
I expected it to flag the doc attribute as red in both my URL and ID attributes.
I also encounter the same issue using Neovim. It seems like this is a regression. Multidoc used to work as far as I remember.
this previously resolved issue might be related: #16 ( Multiple YAML documents in single file features work for first section but not the rest ) and there is also this currently open issue #869 ( intellisense completion breaks with multiple documents in a single file )