configSetsNodocFor method

bool configSetsNodocFor(
  1. String fullName
)

Given an element's location, look up the nodoc configuration data and determine whether to unconditionally treat the element as "nodoc".

Implementation

bool configSetsNodocFor(String fullName) {
  return _configSetsNodocFor.putIfAbsent(fullName, () {
    var file = resourceProvider.getFile(fullName);
    // Direct lookup instead of generating a custom context will save some
    // cycles.  We can't use the element's [DartdocOptionContext] because that
    // might not be where the element was defined, which is what's important
    // for nodoc's semantics.  Looking up the defining element just to pull
    // a context is again, slow.
    var globs = (config.optionSet['nodoc'].valueAt(file.parent) as List)
        .cast<String>();
    if (globs.isNotEmpty) {
      packageGraph.defaultPackage.warn(
        PackageWarning.deprecated,
        message:
            "The '--nodoc' option is deprecated, and will soon be removed.",
      );
    }
    return utils.matchGlobs(globs, fullName);
  });
}