Open suzuki-shunsuke opened 9 hours ago
Describe the bug A clear and concise description of what the bug is.
When we merge two SequenceNodes by ast.Merge, comments are removed.
To Reproduce
Please provide a minimum yaml content that can be reproduced. We are more than happy to use Go Playground
https://go.dev/play/p/xTKF9ON8bUd
Expected behavior A clear and concise description of what you expected to happen.
ast.Merge keeps comments.
- foo # hello - bar - zoo - baz
Screenshots If applicable, add screenshots to help explain your problem.
Version Variables
Additional context Add any other context about the problem here.
I reported the similar issue before. ast.Merge doesn't update ValueHeadComments.
ValueHeadComments
https://github.com/goccy/go-yaml/blob/5d22eed00009e4cd6cf5eaf9848f77c0477d23a8/ast/ast.go#L1473-L1478
✅ I'll create a pull request to resolve this issue. https://github.com/goccy/go-yaml/pull/570
Describe the bug A clear and concise description of what the bug is.
When we merge two SequenceNodes by ast.Merge, comments are removed.
To Reproduce
Please provide a minimum yaml content that can be reproduced. We are more than happy to use Go Playground
https://go.dev/play/p/xTKF9ON8bUd
Expected behavior A clear and concise description of what you expected to happen.
ast.Merge keeps comments.
Screenshots If applicable, add screenshots to help explain your problem.
Version Variables
Additional context Add any other context about the problem here.
I reported the similar issue before. ast.Merge doesn't update
ValueHeadComments
.https://github.com/goccy/go-yaml/blob/5d22eed00009e4cd6cf5eaf9848f77c0477d23a8/ast/ast.go#L1473-L1478
✅ I'll create a pull request to resolve this issue. https://github.com/goccy/go-yaml/pull/570