Skip to main content

IdentifierLocEntry

Struct IdentifierLocEntry 

Source
pub struct IdentifierLocEntry {
    pub start: u32,
    pub loc: SourceLocation,
    pub is_jsx: bool,
    pub opening_element_loc: Option<SourceLocation>,
    pub is_declaration_name: bool,
    pub in_type_annotation: bool,
}
Expand description

Source location and whether the identifier is a JSXIdentifier.

Fields§

§start: u32

The byte offset of the identifier (base.start). Stored here so that callers iterating by node_id can still do position-range containment checks without a separate bridge map.

§loc: SourceLocation§is_jsx: bool§opening_element_loc: Option<SourceLocation>

For JSX identifiers that are the root name of a JSXOpeningElement, stores the JSXOpeningElement’s loc (which spans the full tag).

§is_declaration_name: bool

True if this identifier is the name of a function/class declaration (not an expression reference). Used by gather_captured_context to skip non-expression positions, matching the TS behavior where the Expression visitor doesn’t visit declaration names.

§in_type_annotation: bool

True if this identifier sits inside a type annotation subtree (TypeAnnotation/TSTypeAnnotation/TypeAlias/TSTypeAliasDeclaration). gather_captured_context skips these to match the TS gatherCapturedContext traverse, which skips those subtrees; the hoisting analysis and FindContextIdentifiers do NOT skip them in TS.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.