Return inheritance combination evidence together
This commit is contained in:
@@ -228,17 +228,17 @@ func applyInheritanceSequencePolicy(
|
||||
}
|
||||
|
||||
func applyInheritanceSequenceOrigins(
|
||||
result *inheritanceScope,
|
||||
origins, incomingOrigins map[string]Origin,
|
||||
path Path,
|
||||
lower, higher *document.Node,
|
||||
combined sequenceCombinationResult,
|
||||
operation sequenceMode,
|
||||
) {
|
||||
) []inheritanceReplacement {
|
||||
var replacements []inheritanceReplacement
|
||||
if operation == sequenceModeReplace {
|
||||
if lower != nil {
|
||||
displaced := displacedOrigins(lower, origins, path)
|
||||
result.replacements = append(result.replacements, inheritanceReplacement{
|
||||
replacements = append(replacements, inheritanceReplacement{
|
||||
path: path.clone(), before: lower, after: higher,
|
||||
previous: displaced, effective: cloneOrigin(incomingOrigins[path.String()]),
|
||||
})
|
||||
@@ -253,7 +253,7 @@ func applyInheritanceSequenceOrigins(
|
||||
copyInheritanceSubtreeAt(origins, incomingOrigins, higher.Sequence[projection.inputIndex], path.Index(projection.inputIndex), path.Index(projection.outputIndex))
|
||||
}
|
||||
}
|
||||
return
|
||||
return replacements
|
||||
}
|
||||
|
||||
mergeInheritanceOrigin(origins, path, incomingOrigins[path.String()])
|
||||
@@ -268,7 +268,7 @@ func applyInheritanceSequenceOrigins(
|
||||
previous := displacedOrigins(lower.Sequence[replacement.lowerIndex], origins, lowerPath)
|
||||
deleteOriginSubtree(origins, lowerPath, lower.Sequence[replacement.lowerIndex])
|
||||
copyInheritanceSubtreeAt(origins, incomingOrigins, higher.Sequence[replacement.higherIndex], higherPath, outputPath)
|
||||
result.replacements = append(result.replacements, inheritanceReplacement{
|
||||
replacements = append(replacements, inheritanceReplacement{
|
||||
path: outputPath, before: lower.Sequence[replacement.lowerIndex], after: higher.Sequence[replacement.higherIndex],
|
||||
previous: previous, effective: cloneOrigin(incomingOrigins[higherPath.String()]),
|
||||
})
|
||||
@@ -278,6 +278,7 @@ func applyInheritanceSequenceOrigins(
|
||||
copyInheritanceSubtreeAt(origins, incomingOrigins, higher.Sequence[projection.inputIndex], path.Index(projection.inputIndex), path.Index(projection.outputIndex))
|
||||
}
|
||||
}
|
||||
return replacements
|
||||
}
|
||||
|
||||
func validateRegisteredInheritanceSequences(root *document.Node, rootPath Path, applicationPolicy sequencePolicy) []Diagnostic {
|
||||
|
||||
Reference in New Issue
Block a user