Skip to main content

parse_with_refdefs

Function parse_with_refdefs 

Source
pub fn parse_with_refdefs(
    input: &str,
    options: Option<ParserOptions>,
    refdefs: RefdefMap,
) -> SyntaxNode
Expand description

Parse with a caller-supplied refdef set.

Skips the collect_refdef_labels scan that parse performs. Use this when the caller already has a cached RefdefMap for input — e.g. from a salsa-tracked query — to avoid a redundant document-level scan on every parse.

The supplied refdefs becomes the parser’s refdef set, overriding any value previously set on options.refdef_labels.