Skip to main content

Module doc_link_hints

Module doc_link_hints 

Source
Expand description

#2459: the opt-in hint for an unresolved doc link.

A [Name] in a doc comment that resolves to nothing renders as plain text (the render-only decision, #848), so a typo or a link broken by an edit goes unnoticed. This module turns each unresolved candidate into a low-severity diagnostic, bynk.doc.unresolved_link, with the closest in-scope names as did-you-mean suggestions the code action offers as quick fixes.

LSP-only: the checker and bynk check never see it. The severity is the bynk.docLinks.reportUnresolved setting (off / hint / warning).

Enums§

Level
The bynk.docLinks.reportUnresolved setting.

Constants§

CODE
The diagnostic code. Registered in bynk_syntax::diagnostics::REGISTRY.

Functions§

quick_fix_actions
The did-you-mean quick fixes for the unresolved-link diagnostics the client sent with a codeAction request (context.diagnostics) that intersect requested, against text, the analysed snapshot the edits are versioned to.
quick_fix_edits
The did-you-mean quick-fix edits for one published diagnostic, as (suggestion, range to replace). Empty for any other diagnostic.
unresolved_link_diagnostics
A diagnostic for every unresolved doc link in text, a unit’s source whose own name is owner_unit and whose project-relative path is path. Links resolve exactly as document links do (#2454): the attached declaration’s own parts first (locals supplies its parameters), then the unit scope. Empty when level is Off.