@@ -7,7 +7,7 @@ import 'dart:async';
77import 'package:analyzer/dart/analysis/analysis_context.dart' ;
88import 'package:analyzer/dart/analysis/results.dart' ;
99import 'package:analyzer/dart/ast/ast.dart' ;
10- import 'package:analyzer/dart/element/element2 .dart' ;
10+ import 'package:analyzer/dart/element/element .dart' ;
1111import 'package:analyzer/file_system/file_system.dart' ;
1212// ignore: implementation_imports
1313import 'package:analyzer/src/context/builder.dart' show EmbedderYamlLocator;
@@ -215,10 +215,10 @@ class PubPackageBuilder implements PackageBuilder {
215215 /// Discovers and resolves libraries, invoking [addLibrary] with each result.
216216 ///
217217 /// Uses [processedLibraries] to prevent calling [addLibrary] more than once
218- /// with the same [LibraryElement2 ] . Adds each [LibraryElement2 ] found to
218+ /// with the same [LibraryElement ] . Adds each [LibraryElement ] found to
219219 /// [processedLibraries] .
220220 Future <void > _discoverLibraries (PackageGraph uninitializedPackageGraph,
221- Set <LibraryElement2 > processedLibraries, Set <String > files) async {
221+ Set <LibraryElement > processedLibraries, Set <String > files) async {
222222 files = {...files};
223223 // Discover Dart libraries in a loop. In each iteration of the loop, we take
224224 // a set of files (starting with the ones passed into the function), resolve
@@ -435,7 +435,7 @@ class PubPackageBuilder implements PackageBuilder {
435435 var files = await _getFilesToDocument ();
436436
437437 logInfo ('Discovering libraries...' );
438- var foundLibraries = < LibraryElement2 > {};
438+ var foundLibraries = < LibraryElement > {};
439439 await _discoverLibraries (
440440 uninitializedPackageGraph,
441441 foundLibraries,
@@ -447,9 +447,9 @@ class PubPackageBuilder implements PackageBuilder {
447447
448448 /// Throws an exception if any configured-to-be-included files were not found
449449 /// while gathering libraries.
450- void _checkForMissingIncludedFiles (Set <LibraryElement2 > foundLibraries) {
450+ void _checkForMissingIncludedFiles (Set <LibraryElement > foundLibraries) {
451451 if (_config.include.isNotEmpty) {
452- var knownLibraryNames = foundLibraries.map ((l) => l.name3 );
452+ var knownLibraryNames = foundLibraries.map ((l) => l.name );
453453 var notFound = _config.include
454454 .difference (Set .of (knownLibraryNames))
455455 .difference (_config.exclude);
@@ -482,20 +482,20 @@ class PubPackageBuilder implements PackageBuilder {
482482/// Contains the [ResolvedLibraryResult] and any additional information about
483483/// the library.
484484class DartDocResolvedLibrary {
485- final LibraryElement2 element;
485+ final LibraryElement element;
486486 final List <CompilationUnit > units;
487487
488488 DartDocResolvedLibrary (ResolvedLibraryResult result)
489- : element = result.element2 ,
489+ : element = result.element ,
490490 units = result.units.map ((unit) => unit.unit).toList ();
491491}
492492
493493extension on Set <String > {
494494 /// Adds [element] 's path and all of its part files' paths to `this` , and
495495 /// recursively adds the paths of all imported and exported libraries.
496496 ///
497- /// [element] must be a [LibraryElement2 ] .
498- void addFilesReferencedBy (LibraryElement2 ? element) {
497+ /// [element] must be a [LibraryElement ] .
498+ void addFilesReferencedBy (LibraryElement ? element) {
499499 if (element == null ) return ;
500500
501501 for (var fragment in element.fragments) {
@@ -509,13 +509,13 @@ extension on Set<String> {
509509 var path = fragment.source.fullName;
510510
511511 if (add (path)) {
512- var libraryImports = fragment.libraryImports2 ;
512+ var libraryImports = fragment.libraryImports ;
513513 for (var import in libraryImports) {
514- addFilesReferencedBy (import.importedLibrary2 );
514+ addFilesReferencedBy (import.importedLibrary );
515515 }
516- var libraryExports = fragment.libraryExports2 ;
516+ var libraryExports = fragment.libraryExports ;
517517 for (var export in libraryExports) {
518- addFilesReferencedBy (export.exportedLibrary2 );
518+ addFilesReferencedBy (export.exportedLibrary );
519519 }
520520 }
521521 }
0 commit comments