Closed
Description
Dartdoc has a system of "special classes" (see special_elements.dart
), which are classes defined in the Dart SDK, and which are then used in a few different ways, comparing elements found while documenting with elements from the SDK. For example, "pragma" annotations are treated specially, so when we find an annotated element, we compare each annotation to "pragma".
Instead of taking the strategy that analyzer takes, Dartdoc's SpecialClass and SpecialClasses types hold on to references of the actual special types found in the SDK (like Object and pragma). There is little or no gain to this complex system; we can instead implement predicates like the analyzer has:
class ClassElement {
bool get isDartCoreObject => name == 'Object' && library.isDartCore;
}
class LibraryElement {
bool get isDartCore => name == "dart.core";
}