Folding seems incorrect for BlockMapping
nodes: only the first entry is foldable.
For reference, here is a monaco example that has what I think is correct behavior.
Notes
Altering the fold to replace BlockMapping
with Pair
seems to result in the desired behavior.
E.g.
// src/yaml.ts#L40
// before
foldNodeProp.add({
'BlockSequence BlockMapping BlockLiteral': (node, state) => {
// after
foldNodeProp.add({
'BlockSequence Pair BlockLiteral': (node, state) => {
Obviously, that’s more of hack around this though. This may be an issue with blockEnd
here not terminating BlockMapping
appropriately which throws off the folding logic in lang-yaml
but i’m not certain.