A lookup index for hrefs to allow warnings to indicate where a broken link or orphaned file may have come from. Not cached because ModelElements can be created at any time and we're basing this on more than just allModelElements to make the error messages comprehensive.
Source
Map<String, Set<ModelElement>> get allHrefs { Map<String, Set<ModelElement>> hrefMap = new Map(); // TODO(jcollins-g ): handle calculating hrefs causing new elements better // than toList(). for (ModelElement modelElement in _allConstructedModelElements.values.toList()) { // Technically speaking we should be able to use canonical model elements // only here, but since the warnings that depend on this debug // canonicalization problems, don't limit ourselves in case an href is // generated for something non-canonical. if (modelElement.href == null) continue; hrefMap.putIfAbsent(modelElement.href, () => new Set()); hrefMap[modelElement.href].add(modelElement); } for (Library library in _libraries) { if (library.href == null) continue; hrefMap.putIfAbsent(library.href, () => new Set()); hrefMap[library.href].add(library); } return hrefMap; }