redhat-developer / redhat-developer/vscode-yaml

Formater simply removes the desired blank line between the last line of code and the following comment

Open
#526 0 comments 2 reactions 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

Describe the bug

The extension removes the blank line between the very last active line of code and a following comment block when saving.

In this example the very last line of code is only: issues:

Expected Behavior

# Assign `resolved` as the reason for locking. Set to `false` to disable
setLockReason: false

# Limit to only `issues` or `pulls`
only: issues

# Optionally, specify configuration settings just for `issues` or `pulls`
# issues:
#   exemptLabels:
#     - help-wanted
#   lockLabel: outdated

# pulls:
#   daysUntilLock: 30

# Repository to extend settings from
# _extends: repo

Current Behavior

# Assign `resolved` as the reason for locking. Set to `false` to disable
setLockReason: false

# Limit to only `issues` or `pulls`
only: issues
# Optionally, specify configuration settings just for `issues` or `pulls`
# issues:
#   exemptLabels:
#     - help-wanted
#   lockLabel: outdated

# pulls:
#   daysUntilLock: 30

# Repository to extend settings from
# _extends: repo

Steps to Reproduce

  1. insert the code example of the expected behavior lines into a yaml file
  2. save the file
  3. the desired blank line between
only: issues

and

# Optionally, specify configuration settings just for `issues` or `pulls`

is simply removed.

Environment

  • Windows
  • Mac
  • Linux
  • other (please specify)

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 issue in a YAML file using the formatter on save, comparing the expected and current examples around only: issues. Trace the YAML formatting entry point and existing formatting tests, then verify that the blank line before the following comment block is preserved.

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
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.