@@ -139,8 +139,9 @@ class PackageGraph with CommentReferable, Nameable, ModelBuilder {
139139 // all packages are picked up.
140140 for (var package in _documentedPackages) {
141141 for (var library in package.libraries) {
142- _addToImplementors (library.allClasses);
143- _addToImplementors (library.mixins);
142+ _addToImplementers (library.allClasses);
143+ _addToImplementers (library.mixins);
144+ _addToImplementers (library.extensionTypes);
144145 _extensions.addAll (library.extensions);
145146 }
146147 if (package.isLocal && ! package.hasPublicLibraries) {
@@ -580,7 +581,7 @@ class PackageGraph with CommentReferable, Nameable, ModelBuilder {
580581 return hrefMap;
581582 }
582583
583- void _addToImplementors (Iterable <InheritingContainer > containers) {
584+ void _addToImplementers (Iterable <InheritingContainer > containers) {
584585 assert (! allImplementorsAdded);
585586
586587 // Private containers may not be included in documentation, but may still be
@@ -589,7 +590,7 @@ class PackageGraph with CommentReferable, Nameable, ModelBuilder {
589590 var privates = < InheritingContainer > [];
590591
591592 void checkAndAddContainer (
592- InheritingContainer implemented, InheritingContainer implementor ) {
593+ InheritingContainer implemented, InheritingContainer implementer ) {
593594 if (! implemented.isPublic) {
594595 privates.add (implemented);
595596 }
@@ -598,36 +599,40 @@ class PackageGraph with CommentReferable, Nameable, ModelBuilder {
598599 var list = _implementors.putIfAbsent (implemented, () => []);
599600 // TODO(srawlins): This would be more efficient if we created a
600601 // SplayTreeSet keyed off of `.element`.
601- if (! list.any ((l) => l.element == implementor .element)) {
602- list.add (implementor );
602+ if (! list.any ((l) => l.element == implementer .element)) {
603+ list.add (implementer );
603604 }
604605 }
605606
606- void addImplementor (InheritingContainer clazz ) {
607- var supertype = clazz .supertype;
607+ void addImplementer (InheritingContainer container ) {
608+ var supertype = container .supertype;
608609 if (supertype != null ) {
609610 checkAndAddContainer (
610- supertype.modelElement as InheritingContainer , clazz );
611+ supertype.modelElement as InheritingContainer , container );
611612 }
612- if (clazz is Class ) {
613- for (var type in clazz.mixedInTypes ) {
614- checkAndAddContainer (type.modelElement as InheritingContainer , clazz );
613+ if (container is Class ) {
614+ for (var element in container.mixedInElements ) {
615+ checkAndAddContainer (element, container );
615616 }
616- for (var type in clazz.interfaces) {
617- checkAndAddContainer (type.modelElement as InheritingContainer , clazz);
617+ for (var element in container.interfaceElements) {
618+ checkAndAddContainer (element, container);
619+ }
620+ } else if (container is ExtensionType ) {
621+ for (var element in container.interfaceElements) {
622+ checkAndAddContainer (element, container);
618623 }
619624 }
620- for (var type in clazz.publicInterfaces ) {
621- checkAndAddContainer (type.modelElement as InheritingContainer , clazz );
625+ for (var element in container.publicInterfaceElements ) {
626+ checkAndAddContainer (element, container );
622627 }
623628 }
624629
625- containers.forEach (addImplementor );
630+ containers.forEach (addImplementer );
626631
627632 // [privates] may grow while processing; use a for loop, rather than a
628633 // for-each loop, to avoid concurrent modification errors.
629634 for (var i = 0 ; i < privates.length; i++ ) {
630- addImplementor (privates[i]);
635+ addImplementer (privates[i]);
631636 }
632637 }
633638
@@ -661,10 +666,10 @@ class PackageGraph with CommentReferable, Nameable, ModelBuilder {
661666 ? .linkedName ??
662667 'Object' ;
663668
664- /// The set of [Class] es which should _not_ be presented as implementors .
669+ /// The set of [Class] es which should _not_ be presented as implementers .
665670 ///
666671 /// Add classes here if they are similar to Interceptor in that they are to be
667- /// ignored even when they are the implementors of [Inheritable] s, and the
672+ /// ignored even when they are the implementers of [Inheritable] s, and the
668673 /// class these inherit from should instead claim implementation.
669674 late final Set <Class > inheritThrough = () {
670675 var interceptorSpecialClass = specialClasses[SpecialClass .interceptor];
0 commit comments