redhat-developer / redhat-developer/vscode-yaml

Company like header comments like #--- get formatted to something very different

Open
#917 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug

Company like comment headers get formatted from

#------------------------------------------------------------------------------
# Description : FOO
# Copyright (C) BAR COMPANY (2023)
#------------------------------------------------------------------------------

to

--- #------------------------------------------------------------------------------

#------------------------------------------------------------------------------
# Description : FOO
# Copyright (C) BAR COMPANY (2023)

Expected Behavior

I would expect it to remain the same, ie not be reformatted. Ie look like:

#------------------------------------------------------------------------------
# Description : FOO
# Copyright (C) BAR COMPANY (2023)
#------------------------------------------------------------------------------

Current Behavior

Got reformatted to

--- #------------------------------------------------------------------------------

#------------------------------------------------------------------------------
# Description : FOO
# Copyright (C) BAR COMPANY (2023)

Steps to Reproduce

  1. create a empty yaml file with any content
  2. add #--- (minimum of 3 dashes after # at the top of the file (first line)
  3. on vscode save to reformat
  4. see that it reformatted to something like (added a newline with --- before the original line)
---
#---

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 this in an empty YAML file using the VS Code formatter, starting with a first-line comment containing at least three dashes after #. Trace the YAML formatting entry point that adds the document marker and newline, then verify that the company-style header remains unchanged after formatting.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.