Skip to content

Weird range on key ordering errors #1172

@datho7561

Description

@datho7561

Describe the bug

The range of key ordering errors is weird. Sometimes it starts before the out of order key, sometimes it ends after the out of order key.

Here is an example YAML that shows this behaviour:

one:
  child: moo
two:
  mild: meh
  child: moo
three:
  child: moo

Expected Behavior

There are two errors, one that covers two: and one that covers mild:.

Current Behavior

There are two errors, one that starts at two: and continues to the next line for two characters, and one that starts at mild: but continues past the : by one character.

Steps to Reproduce

  1. Enable key ordering errors, eg. "yaml.keyOrdering": true,
  2. Make the above YAML
  3. Observe the wonky error ranges

Environment

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions