redhat-developer / redhat-developer/vscode-yaml

Weird yaml formatting

Open
#1,070 0 comments 1 reaction 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

This yaml formatter does weird formatting replacement when working with CRDs.

Image

Expected Behavior

autoformat does not replace valid characters with ? and :

Current Behavior

autoformat replaces some characters with ? and :

Steps to Reproduce

  1. Create .yaml file from .txt example manifest provided. (Can not attach .yaml/.yml files to the issue)
  2. Make sure you use redhat.vscode-yaml in your settings.json
    "[yaml]": {
        "editor.defaultFormatter": "redhat.vscode-yaml",
  1. Hit save and see what happens

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 on Linux with the attached cluster-issuer-test.txt manifest and the redhat.vscode-yaml formatter configured in settings.json. Compare the YAML before and after saving, then trace the formatter path responsible for the replacements; done means valid CRD characters are preserved instead of becoming '?' or ':'.

Written by the indexing model from the issue text.

Assessment

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