redhat-developer / redhat-developer/vscode-yaml
Formating removes vertical alignment of values
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 829
- Forks
- 260
- Avg merge
- 5h 43m
- Merged PRs (30d)
- 1
Description
Describe the bug
When formatting the whitespace used for vertical alignment of values is removed, even though the YAML specs allow and encourage it.
Currently there is no way to work around this issue except by disabling the formatter. Installing the Prettier extension keeps the alignment but does not enforce it (by default).
Expected Behavior
When formatting, values vertical alignment to be kept or added
tree:
fruit: "pear"
name: "peartree"
location: "garden"
Current Behavior
Regardless of how they are vertically aligned, they the whitespace is stripped.
tree:
fruit: "pear"
name: "peartree"
location: "garden"
Steps to Reproduce
- Write any YAML file and align the values vertically using spaces
- Format the file using this plugin's formatter
- Alignment is broken
Environment
- Linux
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named in the issue. Reproduce the behavior with the provided YAML example, then locate the plugin's formatter entry point and add coverage showing that vertical value alignment is preserved or added when formatting completes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, yaml
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100