redhat-developer / redhat-developer/yaml-language-server
False positive "Map comment with trailing content" on objects with objects as keys
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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