Only add targetFallback if target is not in defined in current product

This commit is contained in:
Daniel Grumberg
2022-10-25 11:16:20 +01:00
parent 671709f0e7
commit f63db9159b
11 changed files with 80 additions and 75 deletions

View File

@@ -559,7 +559,10 @@ void SymbolGraphSerializer::serializeRelationship(RelationshipKind Kind,
Object Relationship;
Relationship["source"] = Source.USR;
Relationship["target"] = Target.USR;
Relationship["targetFallback"] = Target.Name;
// Emit a fallback if the target is not a symbol that will be part of this
// symbol graph.
if (API.getSymbolForUSR(Target.USR) == nullptr)
Relationship["targetFallback"] = Target.Name;
Relationship["kind"] = getRelationshipString(Kind);
Relationships.emplace_back(std::move(Relationship));