pub fn resolve_doc_link<'a>(
index: &'a ProjectIndex,
doc_scope: &HashMap<String, Vec<String>>,
owner_unit: &str,
name: &str,
) -> Option<&'a SiteRef>Expand description
#848: resolve one intra-doc-link candidate name (from
bynk_ide::symbols::scan_doc_link_candidates) against owner_unit’s
doc-link scope order in doc_scope — the unit itself, then its uses
targets, then its consumes targets (mirrors
bynk_check::index::IndexBuilder::qualify_with’s bare-name
qualification).
A name containing . matches the flat compound member kinds
(DOC_LINK_MEMBER_KINDS, private below) verbatim; otherwise it matches the
bare top-level kinds (DOC_LINK_BARE_KINDS). The first scope-order unit
with any match decides the answer: more than one candidate there is
unresolved (no kind@ disambiguation in this increment — convention-only
resolution) rather than a guess, even if a later unit in scope order would
answer unambiguously. Synthetic (first-party) units are never in
index.symbols (their defs are dropped at assembly), so a name that only
matches through one — e.g. Clock.now — naturally comes back None,
exactly like any other unresolved name.