redhat-developer / redhat-developer/vscode-yaml
Code formatting issue with line length
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 829
- Forks
- 260
- Avg merge
- 5h 43m
- Merged PRs (30d)
- 1
Description
Describe the bug
@msivasubramaniaan, I found the cause of bug #855. It's not related to a schema but to the number of characters. This code doesn't format correctly if any of the first 3 lines have an extra character.
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb:
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc:
error: true
Expected Behavior
Ext should format code correctly, regardless of line length.
Current Behavior
Adding a character to the 3rd line causes this incorrect format.
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb:
? cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccX
: error: true
Steps to Reproduce
- Open VSCode and use the provided code
- Add a character to the first 3 lines
- Save or format the code.
Environment
- Windows
- Mac
- Linux
- other (please specify)
vscode: v1.78.2
yaml ext: v1.13.0
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
Start by reproducing the formatting problem in VSCode with the YAML extension using the sample configuration and the stated version information. Trace the YAML formatter entry point involved in line-length handling; done means the sample formats correctly after adding characters to any of the first three lines, without producing the incorrect mapping-key layout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100