redhat-developer / redhat-developer/vscode-yaml

formatter removes end of document (...) directive.

Open
#765 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I have yaml file like this:

---
tenantName: testTenant
actions:
- action: create
  objectType: tenant
  tenant:
    name: testTenant
...
---
tenantName: testTenant
actions:
- action: create
  objectType: attribute
  signal:
    name: helloAttrOld
...
---
tenantName: testTenant
actions:
- action: update
  objectType: attribute
  attributeName: helloAttrOld
  attribute:
    name: helloAttr
...
---
# similar things
...

But the auto formatter just removes the end of document directives (...) and only keeps the start of the document directive (---).
is there something that I can configure to get around it?

Environment: linux

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 formatter behavior in VS Code using the multi-document YAML example in the issue. Start by tracing the YAML formatter entry point and compare the formatted output with the input; done means preserving each document-end (...) directive while continuing to format the content.

Written by the indexing model from the issue text.

Assessment

Tech stack
yaml
Domain
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.