addImportElement method

void addImportElement(
  1. ImportElement imp
)

Implementation

void addImportElement(ImportElement imp) {
  if (imp.importedLibrary == null) {
    return;
  }
  final modId = imp.importedLibrary!.identifier;
  this._moduleIdToUri[modId] = imp.uri;
  this._uriToModuleId[imp.uri!] = modId;
  if (imp.prefix != null) {
    this._moduleIdToPrefix[modId] = imp.prefix!.name;
    imp.namespace.definedNames.forEach((key, value) {
      _fullNameToPrefix[fullName(value)] = imp.prefix!.name;
    });
  }
}