redhat-developer / redhat-developer/vscode-yaml
YAML `---` for "Multiple documents within a single stream" doesn't work [VSC YAML Plugin]
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 829
- Forks
- 260
- Avg merge
- 5h 43m
- Merged PRs (30d)
- 1
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue using test.yaml and the referenced enola.schema.jsonc schema, checking validation and hover behavior before and after the YAML document separator. Trace the VS Code YAML plugin's handling of multiple documents, and consider the issue complete when both doc fields are flagged and the second name has the schema description on hover.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, yaml
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100