Implement YAML support#37
Conversation
patdhlk
commented
Sep 24, 2025
- allow source trace comments in YAML
- add TCs for YAML
- add documentation for YAML as supported comment type
- add documentation for C-Sharp as supported comment type
- YAML support #36
- allow source trace comments in YAML - add TCs for YAML - add documentation for YAML as supported comment type - add documentation for C-Sharp as supported comment type - #36
Tests for: - Basic key-value pairs - Nested structures - List items - Document structures with --- - Flow mapping structures - complex structures and configs
juiwenchen
left a comment
There was a problem hiding this comment.
Nice work!
It would be nice to know how inline comment will behave in yaml. From the current implementation, it seems it will always find the next node_block as the associated scope. For example
key1: value1 # inline comment
key2: value2The associated block of the comment is key2:value. I also checked how this works in python, and it faces the same situation unless there is no next_named_sblings.
I would propose two options:
- Suggest not to use inline comments in our documentation if info of their associated scope are required
- In our implementation, we can look for
prev_named_siblingon the same row of the comment before go tonext_named_sibling.
The PR is already good to merge, and we can just create a GitHub Issue for the record if we eventually want to support inline comments.
Up to you
- consider YAML inline comments, e.g. key1:value1 #comment1 - add respective TCs
|
@juiwenchen thanks for the hint, I updated the respective YAML parts to support also inline comments. |
juiwenchen
left a comment
There was a problem hiding this comment.
Awesome!
Let's update change_log.rst in the next PR.