pub struct LabelDef {
pub name: SmolStr,
pub range: TextRange,
pub key_range: TextRange,
pub referenced: bool,
}Expand description
A label definition site: either \label{key} or a curated environment’s
label=key option.
Fields§
§name: SmolStr§range: TextRangeRange of the definition for diagnostics and go-to-definition. For
\label, this spans the control word through its key group and excludes
any second group the greedy parser may have over-attached (\label’s
arity is unknown at parse time; see builder::label_range). For an
environment option, it spans the complete label=value entry.
key_range: TextRangeRange of just the trimmed key text (sec:intro in either
\label{sec:intro} or label={sec:intro}). This is the precise span a
rename rewrites—narrower than range, which spans the
whole definition.
referenced: boolSet by the resolve pass when any reference in this file uses name.
This field is per-file only; project consumers consult the cross-file
resolver for namespace-wide references.