@@ -3378,7 +3378,51 @@ class ElementLocationImpl implements ElementLocation {
33783378
33793379/// A shared internal interface of `Element` and [Member] .
33803380/// Used during migration to avoid referencing `Element` .
3381- abstract class ElementOrMember {}
3381+ abstract class ElementOrMember {
3382+ /// The declaration of this element.
3383+ ///
3384+ /// If the element is a view on an element, e.g. a method from an interface
3385+ /// type, with substituted type parameters, return the corresponding element
3386+ /// from the class, without any substitutions. If this element is already a
3387+ /// declaration (or a synthetic element, e.g. a synthetic property accessor),
3388+ /// return itself.
3389+ ElementOrMember ? get declaration;
3390+
3391+ /// The display name of this element, possibly the empty string if the
3392+ /// element does not have a name.
3393+ ///
3394+ /// In most cases the name and the display name are the same. Differences
3395+ /// though are cases such as setters where the name of some setter `set f(x)`
3396+ /// is `f=` , instead of `f` .
3397+ String get displayName;
3398+
3399+ /// The element that either physically or logically encloses this element.
3400+ ///
3401+ /// For [LibraryElement] returns `null` , because libraries are the top-level
3402+ /// elements in the model.
3403+ ///
3404+ /// For [CompilationUnitElement] returns the [CompilationUnitElement] that
3405+ /// uses `part` directive to include this element, or `null` if this element
3406+ /// is the defining unit of the library.
3407+ @Deprecated ('Use Element2.enclosingElement2 instead or '
3408+ 'Fragment.enclosingFragment instead' )
3409+ Element ? get enclosingElement3;
3410+
3411+ /// The kind of element that this is.
3412+ ElementKind get kind;
3413+
3414+ /// The name of this element, or `null` if this element does not have a name.
3415+ String ? get name;
3416+
3417+ /// The length of the name of this element in the file that contains the
3418+ /// declaration of this element, or `0` if this element does not have a name.
3419+ int get nameLength;
3420+
3421+ /// The offset of the name of this element in the file that contains the
3422+ /// declaration of this element, or `-1` if this element is synthetic, does
3423+ /// not have a name, or otherwise does not have an offset.
3424+ int get nameOffset;
3425+ }
33823426
33833427/// An [InterfaceElementImpl] which is an enum.
33843428class EnumElementImpl extends InterfaceElementImpl implements EnumFragment {
@@ -3734,21 +3778,79 @@ abstract class ExecutableElementImpl2 extends FunctionTypedElementImpl2
37343778
37353779/// Common base class for all analyzer-internal classes that implement
37363780/// `ExecutableElement` .
3737- abstract class ExecutableElementOrMember
3738- implements
3739- // ignore:deprecated_member_use_from_same_package,analyzer_use_new_elements
3740- ExecutableElement ,
3741- ElementOrMember {
3781+ abstract class ExecutableElementOrMember implements ElementOrMember {
37423782 @override
3743- List < ParameterElementMixin > get parameters ;
3783+ ExecutableElementOrMember get declaration ;
37443784
37453785 @override
3746- TypeImpl get returnType;
3786+ String get displayName;
3787+
3788+ /// Whether the executable element did not have an explicit return type
3789+ /// specified for it in the original source.
3790+ bool get hasImplicitReturnType;
3791+
3792+ /// Whether the executable element is abstract.
3793+ ///
3794+ /// Executable elements are abstract if they are not external, and have no
3795+ /// body.
3796+ bool get isAbstract;
3797+
3798+ /// Whether the executable element has body marked as being asynchronous.
3799+ bool get isAsynchronous;
37473800
3801+ /// Whether the element is an augmentation.
3802+ ///
3803+ /// If `true` , declaration has the explicit `augment` modifier.
3804+ bool get isAugmentation;
3805+
3806+ /// Whether the executable element is an extension type member.
3807+ bool get isExtensionTypeMember;
3808+
3809+ /// Whether the executable element is external.
3810+ ///
3811+ /// Executable elements are external if they are explicitly marked as such
3812+ /// using the 'external' keyword.
3813+ bool get isExternal;
3814+
3815+ /// Whether the executable element has a body marked as being a generator.
3816+ bool get isGenerator;
3817+
3818+ /// Whether the executable element is an operator.
3819+ ///
3820+ /// The test may be based on the name of the executable element, in which
3821+ /// case the result will be correct when the name is legal.
3822+ bool get isOperator;
3823+
3824+ /// Whether the element is a static element.
3825+ ///
3826+ /// A static element is an element that is not associated with a particular
3827+ /// instance, but rather with an entire library or class.
3828+ bool get isStatic;
3829+
3830+ /// Whether the executable element has a body marked as being synchronous.
3831+ bool get isSynchronous;
3832+
3833+ /// The name of this element, or `null` if this element does not have a name.
37483834 @override
3835+ String get name;
3836+
3837+ /// The parameters defined by this executable element.
3838+ List <ParameterElementMixin > get parameters;
3839+
3840+ /// The return type defined by this element.
3841+ TypeImpl get returnType;
3842+
3843+ /// Return the source associated with this target, or `null` if this target is
3844+ /// not associated with a source.
3845+ Source get source;
3846+
3847+ /// The type defined by this element.
37493848 FunctionTypeImpl get type;
37503849
3751- @override
3850+ /// The type parameters declared by this element directly.
3851+ ///
3852+ /// This does not include type parameters that are declared by any enclosing
3853+ /// elements.
37523854 List <TypeParameterElementImpl > get typeParameters;
37533855}
37543856
0 commit comments