redhat-developer / redhat-developer/vscode-yaml

YAML autocompletion and validation works only for the first YAML definition in a file (schema through modeline)

Open
#1,066 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
829
Forks
260
Avg merge
5h 43m
Merged PRs (30d)
1

Description

Describe the bug

YAML autocompletion and validation works as expected for the first YAML definition in the file.

Screenshot 2024-10-23 at 14 50 52

Validation works also as expected.

Screenshot 2024-10-23 at 14 53 54

When I try to add another YAML definition into the same file, there is no autocompletion or validation available.

Screenshot 2024-10-23 at 14 51 56 Screenshot 2024-10-23 at 14 53 26

Expected Behavior

It would be great if you can add multiple resources with the same or different schema in the same file.

Steps to Reproduce

My schema "test.schema.json" is

{
  "properties": {
    "my_key": {
      "description": "My string",
      "enum": ["my_value"],
      "type": "string"
    }
  },
  "type": "object"
}

Environment

  • Windows
  • Mac
  • Linux
  • other (please specify)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in VS Code with the provided test.schema.json and multiple YAML definitions using schema-through-modeline. Trace the YAML completion and validation behavior for the first and subsequent definitions; done means each resource receives the expected schema-based completion and validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode, yaml
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.