Expand description
#848/#2455: the Markdown link targets of intra-doc links, and the rewrite of
hover Markdown that uses them. Shared by the language server and bynk mcp
(#2520), so both render the same hover.
Functions§
- doc_
link_ target - #848: the
file://target a resolved intra-doc link opens — the defining file, with a#L<line>,<column>fragment (1-based, the form VS Code’s opener reads) placing the cursor on the declaration. Without the fragment a click only opens the file, which for a same-file link (the common case) does nothing visible.snapshotsis the round’s project-relative path → analysed text map, against whichdef.spanis measured; a target missing from it still links, to the file alone. - doc_
link_ url - #2455, #2531: the target of one doc-link candidate — the project scope first
(
crate::index_queries::resolve_doc_link_in, afile://URL), then, only if that finds nothing, the first-party Book entry (first_party_docs, anhttps://URL).ctx(the declaration the doc comment is attached to) lets its own fields and parameters link. Shared bydocument_linkandlinkify_doc_links. - file_
url - The
file://URL of an absolute path. Theurlcrate has no file-path conversion on wasm32 — there is no filesystem to link to — so the playground build yields no link, and a hover there renders the unlinked text. - linkify_
doc_ links - #848: rewrite every resolvable intra-doc-link candidate in
content(hover Markdown — a ```bynk fenced signature, optionally followed by the declaration’s doc-comment prose) into a Markdown link, resolved againstowner_unit’s doc-link scope order (crate::index_queries::resolve_doc_link_in). The fenced signature block (and any author example fence) is never touched —scan_doc_link_candidatesskips fenced regions itself. An unresolved candidate is left exactly as authored — no diagnostic, matching the render-only decision.ctx(the declaration the prose documents) lets its own fields and parameters link (#2454).