Skip to main content

describe_unit

Function describe_unit 

Source
pub fn describe_unit<'s>(
    sources: impl IntoIterator<Item = &'s str>,
    name: &str,
) -> Option<String>
Expand description

#1885: hover Markdown for the unit name — a fenced <kind> <name> line, followed by its module doc when one of its files carries one.

sources are the texts to search: every file of the project the caller can see (a multi-file context’s doc may live in a sibling of the file the cursor is in). A file that declares name as a commons, context or adapter contributes; suite files never do, since a suite’s own doc is not its target’s. At most one file of a unit carries a module doc (bynk.project.duplicate_module_doc); should a broken project have more, the first one in sources order is shown. None when no source declares name.