Expand description
Scan source files for textual references to document ids.
A document id like FEAT-0123 is often mentioned in code — in comments,
string literals, identifiers. The project config ([file_refs]) declares the
textual formats an id may take ({id}, {prefix}{num}, {prefix_lower}_{num},
…); this module renders each format for a set of ids, scans the configured
roots, and reports every hit with enough context to display it or to build a
sed fix command.
This is deliberately separate from crate::refs (the references relation
maps between documents) — here the target is arbitrary source code.
Structs§
- FileRef
- One occurrence of a document id in a source file.
Functions§
- render
- Render a [
RefFormat] template forid, orNoneifidis malformed. Placeholders:{id},{prefix},{prefix_lower},{num},{padded}. - scan
- Scan the configured
rootsfor textual references to any ofids. Returns hits sorted by (path, line, id). Each id is matched in every effective format. - sed_fix
- A
sed -icommand that rewrites every occurrence of one id’s rendered form to the new id’s rendered form inpath.wordmirrors the format so the substitution matches exactly what the scan found.