@@ -495,6 +495,13 @@ abstract class Element2 {
495495 /// be changed if doing so would improve the UX.
496496 String displayString2 ({bool multiline = false , bool preferTypeAlias = false });
497497
498+ /// Returns a display name for the given element that includes the path to the
499+ /// compilation unit in which the type is defined. If [shortName] is `null`
500+ /// then [displayName] will be used as the name of this element. Otherwise
501+ /// the provided name will be used.
502+ // TODO(brianwilkerson): Make the parameter optional.
503+ String getExtendedDisplayName (String ? shortName);
504+
498505 /// Whether the element, assuming that it is within scope, is accessible to
499506 /// code in the given [library] .
500507 ///
@@ -1165,6 +1172,28 @@ abstract class InstanceElement2
11651172
11661173 /// Returns the setter from [setters2] that has the given [name] .
11671174 SetterElement ? getSetter2 (String name);
1175+
1176+ /// Returns the element representing the getter that results from looking up
1177+ /// the given [name] in this class with respect to the given [library] ,
1178+ /// or `null` if the look up fails.
1179+ ///
1180+ /// The behavior of this method is defined by the Dart Language Specification
1181+ /// in section 17.18 Lookup.
1182+ PropertyAccessorElement2 ? lookUpGetter2 ({
1183+ required String name,
1184+ required LibraryElement2 library,
1185+ });
1186+
1187+ /// Returns the element representing the method that results from looking up
1188+ /// the given [name] in this class with respect to the given [library] ,
1189+ /// or `null` if the look up fails.
1190+ ///
1191+ /// The behavior of this method is defined by the Dart Language Specification
1192+ /// in section 17.18 Lookup.
1193+ MethodElement2 ? lookUpMethod2 ({
1194+ required String name,
1195+ required LibraryElement2 library,
1196+ });
11681197}
11691198
11701199/// The portion of an [InstanceElement2] contributed by a single declaration.
@@ -1279,6 +1308,25 @@ abstract class InterfaceElement2 implements InstanceElement2 {
12791308 required List <DartType > typeArguments,
12801309 required NullabilitySuffix nullabilitySuffix,
12811310 });
1311+
1312+ /// Returns the element representing the method that results from looking up
1313+ /// the given [methodName] in the superclass of this class with respect to the
1314+ /// given [library] , or `null` if the look up fails.
1315+ ///
1316+ /// The behavior of this method is defined by the Dart Language Specification
1317+ /// in section 16.15.1:
1318+ /// <blockquote>
1319+ /// The result of looking up method <i>m</i> in class <i>C</i> with respect to
1320+ /// library <i>L</i> is: If <i>C</i> declares an instance method named
1321+ /// <i>m</i> that is accessible to <i>L</i>, then that method is the result of
1322+ /// the lookup. Otherwise, if <i>C</i> has a superclass <i>S</i>, then the
1323+ /// result of the lookup is the result of looking up method <i>m</i> in
1324+ /// <i>S</i> with respect to <i>L</i>. Otherwise, we say that the lookup has
1325+ /// failed.
1326+ /// </blockquote>
1327+ // TODO(scheglov): Deprecate and remove it.
1328+ MethodElement2 ? lookUpInheritedMethod2 (
1329+ String methodName, LibraryElement2 library);
12821330}
12831331
12841332/// The portion of an [InterfaceElement2] contributed by a single declaration.
@@ -1455,6 +1503,12 @@ abstract class LibraryElement2 implements Element2, Annotatable {
14551503 /// of this element's parent.
14561504 String get identifier;
14571505
1506+ /// The libraries that are imported into this library.
1507+ ///
1508+ /// This includes all of the libraries that are imported using a prefix, and
1509+ /// those that are imported without a prefix.
1510+ List <LibraryElement2 > get importedLibraries2;
1511+
14581512 /// Whether the library is the `dart:async` library.
14591513 bool get isDartAsync;
14601514
@@ -1902,6 +1956,9 @@ abstract class MethodElement2 implements ExecutableElement2 {
19021956 /// The test might be based on the name of the executable element, in which
19031957 /// case the result will be correct when the name is legal.
19041958 bool get isOperator;
1959+
1960+ @override
1961+ LibraryElement2 get library2;
19051962}
19061963
19071964/// The portion of a [MethodElement2] contributed by a single declaration.
@@ -2352,6 +2409,9 @@ abstract class TopLevelFunctionElement implements ExecutableElement2 {
23522409 ///
23532410 /// A top-level function is an entry point if it has the name `main` .
23542411 bool get isEntryPoint;
2412+
2413+ @override
2414+ LibraryElement2 get library2;
23552415}
23562416
23572417/// The portion of a [TopLevelFunctionElement] contributed by a single
0 commit comments