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: u32The 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: boolTrue 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: boolTrue 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.