Skip to content

Formatting Docker Compose files removes the YAML document end #93

@ferrarimarco

Description

@ferrarimarco

Hi all!

I noticed that formatting a Docker Compose file strips away the YAML end document marker (...). This doesn't happen if you manually set a Docker Compose file as a YAML file, and format it.

Steps to reproduce:

  1. Create a Docker Compose file named compose.yaml (although any other file name recognized by the dockercompose language definition would work).
  2. Ensure that VS Code recognizes the file compose.yaml file as a Docker Compose file (look for the Compose language mode in the status bar (bottom right).
  3. Paste the following content in the file:
    ---
    services:
      test-service-1:
    ...
  4. Save the file.
  5. Format the file (if you don't have "Format on Save" enabled).

The resulting, formatted file is:

---
services:
  test-service-1:

While I was expecting:

---
services:
  test-service-1:
...

Is this behavior something I can configure? Or is it a bug?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    externalIssue is external to this repo

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions