Generalising the empty array fix to map

This commit is contained in:
Mike Farah
2026-08-03 13:31:47 +10:00
parent b74aefd55f
commit 7862131c9c
5 changed files with 19 additions and 7 deletions
+4 -3
View File
@@ -69,10 +69,11 @@ func deleteFromMap(node *CandidateNode, childPath interface{}) {
}
}
node.Content = newContents
normaliseEmptyCollectionMapKeyComment(node)
}
func normaliseEmptySequenceMapKeyComment(node *CandidateNode) {
if node.Kind != SequenceNode || len(node.Content) != 0 || node.LineComment != "" {
func normaliseEmptyCollectionMapKeyComment(node *CandidateNode) {
if (node.Kind != SequenceNode && node.Kind != MappingNode) || len(node.Content) != 0 || node.LineComment != "" {
return
}
@@ -110,5 +111,5 @@ func deleteFromArray(node *CandidateNode, childPath interface{}) {
}
}
node.Content = newContents
normaliseEmptySequenceMapKeyComment(node)
normaliseEmptyCollectionMapKeyComment(node)
}