help method

String? help(
  1. dynamic id, {
  2. String? moduleName,
})

Get the documentation of a declaration in a certain namespace.

Implementation

String? help(
  dynamic id, {
  String? moduleName,
}) {
  try {
    if (id is HTDeclaration) {
      return id.documentation;
    } else if (id is String) {
      HTNamespace nsp = getNamespace(moduleName: moduleName);
      return nsp.help(id);
    } else {
      throw 'The argument of the `help` api [$id] is neither a defined symbol nor a string.';
    }
  } catch (error, stackTrace) {
    if (config.processError) {
      processError(error, stackTrace);
      return null;
    } else {
      rethrow;
    }
  }
}