Skip to content

Commit e8a9af4

Browse files
bwilkersonCommit Queue
authored andcommitted
Add FindElement2 as a replacement for FindElement in tests
If it would be helpful I can redo this CL with two patchsets, one that adds the new class as a copy of the old and a second that makes all of the changes to it. Change-Id: Ie7a044fbd08d12fde1c942e54f6927e0cf95cacd Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/390921 Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Brian Wilkerson <[email protected]>
1 parent 465de40 commit e8a9af4

File tree

3 files changed

+616
-0
lines changed

3 files changed

+616
-0
lines changed

pkg/analyzer/lib/dart/element/element2.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import 'package:analyzer/dart/constant/value.dart';
5151
import 'package:analyzer/dart/element/element.dart'
5252
show
5353
DirectiveUri,
54+
DirectiveUriWithUnit,
5455
ElementAnnotation,
5556
ElementKind,
5657
ElementLocation,
@@ -2304,3 +2305,8 @@ abstract class VariableFragment implements Fragment {
23042305
/// even though they are implicitly final.
23052306
bool get isFinal;
23062307
}
2308+
2309+
extension DirectiveUriWithUnitExtension on DirectiveUriWithUnit {
2310+
/// The library fragment associated with this directive.
2311+
LibraryFragment get libraryFragment => unit as LibraryFragment;
2312+
}

0 commit comments

Comments
 (0)