redhat-developer / redhat-developer/vscode-yaml

Applying a Compose completion item makes my YAML file malformed

Open
#1,114 4 comments 0 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

Code completion "in between" another attribute seems to "reuse" the content after it and produces a malformed YAML file.

Expected Behavior

Applying a completion item produce a reasonable YAML file perhaps missing an attribute's value for me to type.

Current Behavior

Applying this completion item has made my YAML file look even worse than it started.

Steps to Reproduce

  1. Create compose.yaml with the content below.
  2. Invoke code completion on the - bi line.
  3. Accept the bind and the applied content appears to be corrupt.
  4. I only have the Red Hat extension enabled and the Docker ones have been disabled.
services:
  test:
    volumes:
      - bi
        type: tmpfs

https://github.com/user-attachments/assets/bb68f459-47ea-430f-aab5-7b36e3958df8

Image

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 compose.yaml with completion invoked on the - bi line and the bind item accepted. Compare the resulting document with the expected valid YAML and verify that completion no longer reuses the following type: tmpfs content.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.