@@ -396,19 +396,50 @@ abstract class FormalParameterElement
396
396
abstract class FormalParameterFragment
397
397
implements PromotableFragment , _Annotatable {}
398
398
399
+ /// A fragment that wholly or partially defines an element.
400
+ ///
401
+ /// When an element is defined by one or more fragments, those fragments form an
402
+ /// augmentation chain. This is represented in the element model as a
403
+ /// doubly-linked list.
404
+ ///
405
+ /// In valid code the first fragment is the base declaration and all of the
406
+ /// other fragments are augmentations. This can be violated in the element model
407
+ /// in the case of invalid code, such as when an augmentation is declared even
408
+ /// though there is no base declaration.
399
409
abstract class Fragment {
400
- List <Fragment > get children;
410
+ /// The children of this fragment.
411
+ ///
412
+ /// There is no guarantee of the order in which the children will be returned.
413
+ /// For example, they are not guaranteed to be in lexical order.
414
+ List <Fragment > get children3;
401
415
416
+ /// The element composed from this fragment and possibly other fragments.
402
417
Element2 get element;
403
418
419
+ /// The fragment that either physically or logically encloses this fragment.
420
+ ///
421
+ /// Returns `null` if this fragment is the root fragment of a library because
422
+ /// there are no fragments above the root fragment of a library.
404
423
Fragment ? get enclosingFragment;
405
424
425
+ /// The library fragment that contains this fragment.
426
+ ///
427
+ /// This will be the fragment itself if it is a library fragment.
406
428
LibraryFragment get libraryFragment;
407
429
430
+ /// The offset of the name in this fragment.
431
+ ///
432
+ /// Returns `null` if the fragment has no name.
408
433
int ? get nameOffset;
409
434
435
+ /// The next fragment in the augmentation chain.
436
+ ///
437
+ /// Returns `null` if this is the last fragment in the chain.
410
438
Fragment ? get nextFragment;
411
439
440
+ /// The previous fragment in the augmentation chain.
441
+ ///
442
+ /// Returns `null` if this is the first fragment in the chain.
412
443
Fragment ? get previousFragment;
413
444
}
414
445
@@ -519,56 +550,133 @@ abstract class LabelElement2 implements Element2 {
519
550
LibraryElement2 get library2;
520
551
}
521
552
553
+ /// A library.
554
+ ///
555
+ /// Clients may not extend, implement or mix-in this class.
522
556
abstract class LibraryElement2 implements Element2 , _Annotatable , _Fragmented {
523
- List <ExtensionElement2 > get accessibleExtensions;
557
+ /// The extension elements accessible within this library.
558
+ List <ExtensionElement2 > get accessibleExtensions2;
524
559
560
+ /// The classes defined in this library.
561
+ ///
562
+ /// There is no guarantee of the order in which the classes will be returned.
563
+ /// For example, they are not guaranteed to be in lexical order.
525
564
List <ClassElement2 > get classes;
526
565
527
- TopLevelFunctionElement ? get entryPoint;
566
+ /// The entry point for this library.
567
+ ///
568
+ /// Returns `null` if this library doesn't have an entry point.
569
+ ///
570
+ /// The entry point is defined to be a zero, one, or two argument top-level
571
+ /// function whose name is `main` .
572
+ TopLevelFunctionElement ? get entryPoint2;
528
573
574
+ /// The enums defined in this library.
575
+ ///
576
+ /// There is no guarantee of the order in which the enums will be returned.
577
+ /// For example, they are not guaranteed to be in lexical order.
529
578
List <EnumElement2 > get enums;
530
579
580
+ /// The libraries that are exported from this library.
581
+ ///
582
+ /// There is no guarantee of the order in which the libraries will be
583
+ /// returned. For example, they are not guaranteed to be in lexical order.
531
584
List <LibraryElement2 > get exportedLibraries2;
532
585
586
+ /// The export [Namespace] of this library.
533
587
Namespace get exportNamespace;
534
588
589
+ /// The extensions defined in this library.
590
+ ///
591
+ /// There is no guarantee of the order in which the extensions will be
592
+ /// returned. For example, they are not guaranteed to be in lexical order.
535
593
List <ExtensionElement2 > get extensions;
536
594
595
+ /// The extension types defined in this library.
596
+ ///
597
+ /// There is no guarantee of the order in which the extension types will be
598
+ /// returned. For example, they are not guaranteed to be in lexical order.
537
599
List <ExtensionTypeElement2 > get extensionTypes;
538
600
601
+ /// The set of features available to this library.
602
+ ///
603
+ /// Determined by the combination of the language version for the enclosing
604
+ /// package, enabled experiments, and the presence of a `// @dart` language
605
+ /// version override comment at the top of the files that make up the library.
539
606
FeatureSet get featureSet;
540
607
608
+ @override
609
+ LibraryFragment get firstFragment;
610
+
611
+ /// The functions defined in this library.
612
+ ///
613
+ /// There is no guarantee of the order in which the functions will be
614
+ /// returned. For example, they are not guaranteed to be in lexical order.
541
615
List <TopLevelFunctionElement > get functions;
542
616
617
+ /// The getters defined in this library.
618
+ ///
619
+ /// There is no guarantee of the order in which the getters will be returned.
620
+ /// For example, they are not guaranteed to be in lexical order.
543
621
List <GetterElement > get getters;
544
622
623
+ /// The identifier that uniquely identifies this element among the children
624
+ /// of this element's parent.
545
625
String get identifier;
546
626
627
+ /// Whether the library is the `dart:async` library.
547
628
bool get isDartAsync;
548
629
630
+ /// Whether the library is the `dart:core` library.
549
631
bool get isDartCore;
550
632
633
+ /// Whether the library is part of the SDK.
551
634
bool get isInSdk;
552
635
636
+ /// The language version for this library.
553
637
LibraryLanguageVersion get languageVersion;
554
638
555
639
@override
556
640
LibraryElement2 get library2;
557
641
558
- TopLevelFunctionElement get loadLibraryFunction;
642
+ /// The element representing the synthetic function `loadLibrary` .
643
+ ///
644
+ /// Technically the function is implicitly defined for this library only if
645
+ /// the library is imported using a deferred import, but the element is always
646
+ /// defined for performance reasons.
647
+ TopLevelFunctionElement get loadLibraryFunction2;
559
648
649
+ /// The mixins defined in this library.
650
+ ///
651
+ /// There is no guarantee of the order in which the mixins will be returned.
652
+ /// For example, they are not guaranteed to be in lexical order.
560
653
List <MixinElement2 > get mixins;
561
654
655
+ /// The public [Namespace] of this library.
562
656
Namespace get publicNamespace;
563
657
658
+ /// The setters defined in this library.
659
+ ///
660
+ /// There is no guarantee of the order in which the setters will be returned.
661
+ /// For example, they are not guaranteed to be in lexical order.
564
662
List <SetterElement > get setters;
565
663
664
+ /// The top level variables defined in this library.
665
+ ///
666
+ /// There is no guarantee of the order in which the top level variables will
667
+ /// be returned. For example, they are not guaranteed to be in lexical order.
566
668
List <TopLevelVariableElement2 > get topLevelVariables;
567
669
670
+ /// The type aliases defined in this library.
671
+ ///
672
+ /// There is no guarantee of the order in which the type aliases will be
673
+ /// returned. For example, they are not guaranteed to be in lexical order.
568
674
List <TypeAliasElement2 > get typeAliases;
569
675
676
+ /// The [TypeProvider] that is used in this library.
570
677
TypeProvider get typeProvider;
571
678
679
+ /// The [TypeSystem] that is used in this library.
572
680
TypeSystem get typeSystem;
573
681
}
574
682
@@ -582,37 +690,63 @@ abstract class LibraryExport {
582
690
DirectiveUri get uri;
583
691
}
584
692
693
+ /// The portion of a [LibraryElement2] coming from a single compilation unit.
585
694
abstract class LibraryFragment implements Fragment , _Annotatable {
695
+ /// The fragments of the classes declared in this fragment.
586
696
List <ClassFragment > get classes2;
587
697
698
+ @override
699
+ LibraryFragment ? get enclosingFragment;
700
+
701
+ /// The fragments of the enums declared in this fragment.
588
702
List <EnumFragment > get enums2;
589
703
704
+ /// The fragments of the extensions declared in this fragment.
590
705
List <ExtensionFragment > get extensions2;
591
706
707
+ /// The fragments of the extension types declared in this fragment.
592
708
List <ExtensionTypeFragment > get extensionTypes2;
593
709
710
+ /// The fragments of the top-level functions declared in this fragment.
594
711
List <TopLevelFunctionFragment > get functions2;
595
712
713
+ /// The fragments of the top-level getters declared in this fragment.
596
714
List <GetterFragment > get getters;
597
715
598
- List <LibraryExport > get libraryExports;
716
+ /// The libraries exported by this unit.
717
+ List <LibraryExport > get libraryExports2;
599
718
600
- List <LibraryImport > get libraryImports;
719
+ /// The libraries imported by this unit.
720
+ List <LibraryImport > get libraryImports2;
601
721
722
+ /// The [LineInfo] for the fragment.
602
723
LineInfo get lineInfo;
603
724
725
+ /// The fragments of the mixins declared in this fragment.
604
726
List <MixinFragment > get mixins2;
605
727
728
+ /// The parts included by this unit.
606
729
List <PartInclude > get partIncludes;
607
730
731
+ /// The prefixes used by [libraryImports] .
732
+ ///
733
+ /// Each prefix can be used in more than one `import` directive.
608
734
List <PrefixElement2 > get prefixes;
609
735
736
+ /// The scope used to resolve names within the fragment.
737
+ ///
738
+ /// It includes all of the elements that are declared in the library, and all
739
+ /// of the elements imported into this fragment or parent fragments.
610
740
Scope get scope;
611
741
742
+ /// The fragments of the top-level setters declared in this fragment.
612
743
List <SetterFragment > get setters;
613
744
745
+ /// The fragments of the top-level variables declared in this compilation
746
+ /// unit.
614
747
List <TopLevelVariableFragment > get topLevelVariables2;
615
748
749
+ /// The fragments of the type aliases declared in this fragment.
616
750
List <TypeAliasFragment > get typeAliases2;
617
751
}
618
752
0 commit comments