redhat-developer / redhat-developer/yaml-language-server

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

Open
#1,216 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug upstream
Dominant language
TypeScript
Stars
1.5k
Forks
352
Avg merge
2d 7h
Merged PRs (30d)
11

Description

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.

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

Start by reproducing the reported snippets in the YAML language server, comparing the single inline object key with multiple keys. Trace the diagnostic that reports "Map comment with trailing content" and add coverage for the failing examples; done means valid inline object keys no longer produce that error.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.