commentRefs property

Map<String, ModelCommentReference> commentRefs

A map of ModelCommentReference.codeRef to ModelCommentReference. This map deduplicates comment references as all identical reference strings inside a single documentation comment will point to the same place, so it should not be used to count exactly how many references there are.


Map<String, ModelCommentReference> get commentRefs {
  if (_commentRefs == null) {
    _commentRefs = {};
    for (var from in documentationFrom) {
      var checkReferences = <ModelElement>[from];
      if (from is Accessor) {
      for (var e in checkReferences) {
        // Some elements don't have modelNodes or aren't traversed by
        // the element visitor, or both.
        assert(e is Parameter || e.modelNode != null);
          for (var r in e.modelNode?.commentRefs ?? <ModelCommentReference>[])
            r.codeRef: r
  return _commentRefs;