redhat-developer / redhat-developer/vscode-yaml

Auto-complete for an object only inserts one of the required properties and it's not the 1st one

Open
#524 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug

The schema definition has multiple required properties. Auto-complete for an object only inserts one of the required properties and it's not the 1st one in the list.

Schema: https://raw.githubusercontent.com/Cloud-Pipelines/component_spec_schema/stable/component_spec.json_schema.json,

Relevant schema definition:

    "IfPlaceholder": {
      "description": "Represents the command-line argument placeholder that will be replaced at run-time by a boolean value specifying whether the caller has passed an argument for the specified optional input.",
      "type": "object",
      "required": ["if"],
      "properties": {
        "if" : {
          "type": "object",
          "required": ["cond", "then"],
          "properties": {
            "cond": {"$ref": "#/definitions/IfConditionArgumentType"},
            "then": {"$ref": "#/definitions/StringOrPlaceholder"},
            "else": {"$ref": "#/definitions/StringOrPlaceholder"}
          }
        }
      }
    },

Steps to Reproduce

Use TAB for auto-complete if:

implementation:
  container:
    image: alpine
    command:
      - if<TAB>

Current Behavior

      - if:
          then:
            -

Expected Behavior

      - if:
          cond: ???
          then:
            -

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

Reproduce the issue in VS Code using the linked component schema and the YAML command example, then trace the autocomplete handling for object properties with multiple required fields. Done means completing if inserts both cond and then, with cond appearing first as shown in the expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode, yaml
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.