pub struct DefSite {
pub name: SmolStr,
pub kind: DefSiteKind,
pub name_range: TextRange,
pub range: TextRange,
}Expand description
One user definition’s location — the range-bearing sibling of the signature
facts scan_definitions extracts. Signatures stay range-free so the
document_signatures salsa query backdates on pure-offset edits; definition
sites feed LSP navigation (goto-definition, references, rename), which needs
byte ranges and recomputes them per request off the memoized tree.
Fields§
§name: SmolStrThe defined name (no leading \ for commands).
kind: DefSiteKind§name_range: TextRangeThe defined name’s own span. For a command this is the \name control-word
token, backslash included, so it compares equal to the same token found by an
occurrence walk; for an environment it is the name text between the braces of
\newenvironment{name} (the environment_name_range convention).
range: TextRangeThe whole definition’s span, through the sibling name COMMAND in the
unbraced \newcommand\foo…/\def\foo… forms.