Skip to content

False positive "Map comment with trailing content" on objects with objects as keys #1216

@wsulais

Description

@wsulais

Describe the bug

Inline object keys are accept as a part of the YAML spec. Yet objects that contain more than one of them cause LSP errors.d

The following yaml is accepted

foo:
  { bar: 1 }: 1

But the following examples do cause the "Map comment with trailing content" error to always happens on the last line

foo:
  { bar: 1 }: 1
  { bar: 2 }: 1
foo:
  { bar: 1 }: 1
  { bar: 2 }: 1
  { bar: 3 }: 1

Environment

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

Can reproduce with 1.19.2 and 1.21, i'm using nixpkgs built yaml-language-server.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions