Skip to main content

doc_link_spans

Function doc_link_spans 

Source
pub fn doc_link_spans(source: &str) -> Vec<(String, Span)>
Expand description

#848: the (candidate name, absolute source span) of every intra-doc-link candidate inside every DocBlock token in source — the clickable ranges for doc-comment document links, mirroring unit_reference_spans’s role for uses/consumes targets. Spans are computed against the raw, unstripped doc-block body (bynk_syntax::lexer::doc_block_body_range), not the common-indent-stripped doc_block_content text — that stripping is not offset-preserving, so a span-based caller must avoid it. Only tokenizes (not a full parse), so links still surface even when the rest of the file has a parse error elsewhere, as long as tokenization succeeds.