Skip to content

Key ordering quickfix breaks YAML #1171

@datho7561

Description

@datho7561

Describe the bug

When applying the 'key ordering' quickfix to make the keys in alphabetical order, certain parts of the YAML get broken.

Here is an example case:

one:
  child: moo
two:
  child: moo
three:
  child: moo

Apply the quickfix to order two after three

Expected Behavior

When the quickfix is applied, the resulting YAML represents the same data. I am expecting the resulting YAML to look like this:

one:
  child: moo
two:
  child: moo
three:
  child: moo

Current Behavior

one:
  child: moo
three:
  child: mootwo:
  child: moo

Steps to Reproduce

  1. Enable key ordering errors, eg. "yaml.keyOrdering": true,
  2. Make the above example YAML
  3. Apply the quickfix

Environment

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions