yaml-language-server icon indicating copy to clipboard operation
yaml-language-server copied to clipboard

YAML `---` for "Multiple documents within a single stream" doesn't work [YAML Language Server]

Open vorburger opened this issue 1 year ago • 7 comments

[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.

vorburger avatar Dec 21 '23 00:12 vorburger

I also encounter the same issue using Neovim. It seems like this is a regression. Multidoc used to work as far as I remember.

AnhQuanTrl avatar Mar 01 '24 14:03 AnhQuanTrl

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 )

ionous avatar Jul 01 '24 20:07 ionous