Document unit
Generates or repairs managed DocInsight comments for every public declaration in the unit open in the active editor (facts-only).
Read this when the file you are editing needs documentation, not just one symbol. Right-click in the Structure form and choose Document unit to generate or repair managed DocInsight comments for every public declaration in the active editor file; the node you clicked does not matter. A declaration whose stored block names Calls: entries of a unit the chosen index cannot see is left untouched and reported as REFUSED (JSON key refused) instead of being rewritten.
How to run it
Full flag list: document in the CLI reference.
Flags
| Flag | Argument | Meaning | Default |
|---|---|---|---|
--qname | <Foo.TBar.Baz> | ||
--apply | |||
--json | |||
--no-backup | |||
--migrate-pure | |||
--db | PATH |
Where to click
- Right-click in the Structure form: Document unit
- Open the Structure form (drag-lint > Show Structure)
- Right-click the unit node
- Choose Document unit; managed DocInsight comments are generated or repaired for its public declarations
Details
Generates or repairs managed DocInsight comments for every public declaration in the unit represented by a Structure-tree node (facts-only). Reach for it when a whole unit needs documentation, not just one symbol.
Running it from the CLI
The feature map lists the underlying verb as document. From the usage
banner, the whole-unit form:
drag-lint document --unit <file.pas> [--apply|--json|--no-backup|--include-accessors] [--db PATH]
Documents every public declaration in the unit (facts-only). Trivial
Get*/Set* accessors are skipped unless --include-accessors is given.
What it needs
Optional, per the feature map's Index column.
Example
Illustrative:
drag-lint document --unit C:\Projects\MyApp\Unit1.pas --apply --db C:\Projects\MyApp\_D-RAG\MyApp.sqlite
This would write managed DocInsight comments onto every public declaration
in Unit1.pas.
Refusals
--apply refuses the whole run (exit 1, nothing written) on an index that is still being written or whose run did not finish, and when the rescan of a file known to disagree with its source fails (1.53.1) -- see Document project.
A declaration whose stored block names Calls: entries of a unit the chosen --db cannot see is left untouched: document --apply prints doc: REFUSED <qname> ... on stderr, a summary line, and the JSON refused count (--qname: refused text). Index that unit, or edit the block by hand. Exit code stays 0. The (+N more) tail of a capped list is not an entry: a capped list whose units the index holds is regenerated, not refused.