Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trailing comments are not well assigned #244

Closed
eemeli opened this issue Mar 13, 2021 · 0 comments · Fixed by #278
Closed

Trailing comments are not well assigned #244

eemeli opened this issue Mar 13, 2021 · 0 comments · Fixed by #278
Assignees
Labels
bug Something isn't working

Comments

@eemeli
Copy link
Owner

eemeli commented Mar 13, 2021

Describe the bug
Some trailing comments don't get assigned to the best possible node during parsing & composition.

To Reproduce
Un-skip this section of the test suite, and observe the results, in particular for the 1 comments.

Expected behaviour
Either these comments should get assigned the same was as they did with the old parser, or we should have a really good story for why they ought to be handled differently.

Versions (please complete the following information):

  • yaml: 2.0.0-4

Additional context
This is tough. The YAML spec says nothing about comments, so the only real yardstick is what "feels right". It's also tricky to handle at the end of a collection, when any number of surrounding collections might also be ending, and you can't tell until the next actual value which all of those ought to even be considered as the place to assign a trailing comment.

@eemeli eemeli added the bug Something isn't working label Mar 13, 2021
@eemeli eemeli self-assigned this Mar 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant