Skip to content

Add formatter option to preserve YAML document end marker (...) for Ansible files #1211

@djobin

Description

@djobin

Is your enhancement related to a problem? Please describe.

After updating redhat.vscode-yaml to 1.20.0, I can now use the YAML formatter on Ansible files (ansible / ansible-jinja), which is great.

However, formatting on save removes the explicit YAML document end marker (...).
In my team, this marker is required by convention, so we need to keep it when present.

Describe the solution you would like

Please add a formatter setting to preserve YAML document markers, especially the document end marker (...) when it is already present.

Example idea:

  • yaml.format.preserveDocumentEndMarker: true (or similar)

This would let users keep the formatter enabled for Ansible files without losing required document markers.

Describe alternatives you have considered

  • Disabling format on save for Ansible: avoids marker removal, but we lose formatter benefits.
  • Disabling YAML formatter completely: same issue, too broad.
  • Pinning older extension versions: not ideal long-term.

Additional context

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions