Skip to main content

format_node_range_grouped

Function format_node_range_grouped 

Source
pub fn format_node_range_grouped(
    node: &SyntaxNode,
    range: TextRange,
    style: GroupingStyle<'_>,
) -> Option<(TextRange, String)>
Expand description

format_node_range under an explicit grouping style, measuring the alignment itself.

Prefer this over pairing a caller-supplied alignment with a alignment: the alignment MUST have been measured under the same style, and doing both here makes that unfalsifiable. Costs one compute_alignment walk, which is why the ungrouped hot path still uses the cached alignment.