@@ -448,11 +448,24 @@ void
448
448
SymbolGraph::recordConformanceRelationships (Symbol S) {
449
449
const auto VD = S.getSymbolDecl ();
450
450
if (const auto *NTD = dyn_cast<NominalTypeDecl>(VD)) {
451
- for (const auto *Conformance : NTD->getAllConformances ()) {
452
- recordEdge (Symbol (this , VD, nullptr ),
453
- Symbol (this , Conformance->getProtocol (), nullptr ),
454
- RelationshipKind::ConformsTo (),
455
- dyn_cast_or_null<ExtensionDecl>(Conformance->getDeclContext ()));
451
+ if (auto *PD = dyn_cast<ProtocolDecl>(NTD)) {
452
+ PD->walkInheritedProtocols ([&](ProtocolDecl *inherited) {
453
+ if (inherited != PD) {
454
+ recordEdge (Symbol (this , VD, nullptr ),
455
+ Symbol (this , inherited, nullptr ),
456
+ RelationshipKind::ConformsTo (),
457
+ nullptr );
458
+ }
459
+
460
+ return TypeWalker::Action::Continue;
461
+ });
462
+ } else {
463
+ for (const auto *Conformance : NTD->getAllConformances ()) {
464
+ recordEdge (Symbol (this , VD, nullptr ),
465
+ Symbol (this , Conformance->getProtocol (), nullptr ),
466
+ RelationshipKind::ConformsTo (),
467
+ dyn_cast_or_null<ExtensionDecl>(Conformance->getDeclContext ()));
468
+ }
456
469
}
457
470
}
458
471
}
0 commit comments