Elements. Migrate FindElement2.
Change-Id: Ia5b901fbe8a7666a829628dcf9056c35e99f20bd Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396460 Reviewed-by: Phil Quitslund <pquitslund@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
committed by
Commit Queue
parent
dcee4f2d4d
commit
156ff660f6
@@ -160,7 +160,6 @@ lib/src/summary2/types_builder.dart
|
||||
lib/src/summary2/variance_builder.dart
|
||||
lib/src/task/strong_mode.dart
|
||||
lib/src/test_utilities/find_element.dart
|
||||
lib/src/test_utilities/find_element2.dart
|
||||
lib/src/test_utilities/find_node.dart
|
||||
lib/src/test_utilities/mock_sdk_elements.dart
|
||||
lib/src/util/ast_data_extractor.dart
|
||||
|
||||
@@ -546,6 +546,10 @@ abstract class DirectiveUriWithSource extends DirectiveUriWithRelativeUri {
|
||||
///
|
||||
/// Clients may not extend, implement or mix-in this class.
|
||||
abstract class DirectiveUriWithUnit extends DirectiveUriWithSource {
|
||||
/// The library fragment referenced by the [source].
|
||||
@experimental
|
||||
LibraryFragment get libraryFragment;
|
||||
|
||||
/// The unit referenced by the [source].
|
||||
CompilationUnitElement get unit;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,6 @@ import 'package:analyzer/dart/constant/value.dart';
|
||||
import 'package:analyzer/dart/element/element.dart'
|
||||
show
|
||||
DirectiveUri,
|
||||
DirectiveUriWithUnit,
|
||||
ElementAnnotation,
|
||||
ElementKind,
|
||||
ElementLocation,
|
||||
@@ -2582,8 +2581,3 @@ abstract class VariableFragment implements Fragment {
|
||||
@override
|
||||
VariableFragment? get previousFragment;
|
||||
}
|
||||
|
||||
extension DirectiveUriWithUnitExtension on DirectiveUriWithUnit {
|
||||
/// The library fragment associated with this directive.
|
||||
LibraryFragment get libraryFragment => unit as LibraryFragment;
|
||||
}
|
||||
|
||||
@@ -1913,6 +1913,9 @@ class DirectiveUriWithUnitImpl extends DirectiveUriWithRelativeUriImpl
|
||||
required this.unit,
|
||||
});
|
||||
|
||||
@override
|
||||
LibraryFragment get libraryFragment => unit;
|
||||
|
||||
@override
|
||||
Source get source => unit.source;
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ bool _isOldModelElement(Element2? element) {
|
||||
'DirectiveUriWithRelativeUri',
|
||||
'DirectiveUriWithRelativeUriString',
|
||||
'DirectiveUriWithSource',
|
||||
'DirectiveUriWithUnit',
|
||||
'ElementAnnotation',
|
||||
'ElementKind',
|
||||
'ElementLocation',
|
||||
|
||||
Reference in New Issue
Block a user