Delphi-RAG-Lint
← DL (drag-lint) · Document your code

Documentation from facts, not guesses.

DL writes XML documentation comments into your source from what its index knows about each declaration: the /// comments Delphi itself shows in its Help Insight popups, in the format DocInsight reads too. It also tells you when a comment no longer matches the code. It does not make prose up: by default it writes only facts, and a summary only when it can take one from a comment you already have next to the declaration.

01 — Write

One symbol, one unit, or the whole project

A DL-written doc-comment shown in the RAD Studio editor

In the editor

The comment shows up in RAD Studio’s Help Insight popup like any Delphi XML doc comment, and DocInsight reads it too.

Auto-document a project →

In RAD Studio, right-click a symbol in the Structure window and choose Document it, or document the unit in the editor, or the whole project. From the command line, document handles one symbol and document-all every public declaration in the index. Auto-Document Whole Project runs as one batch of reindex, document and reindex, so the index knows the new comments straight away. Trivial Get and Set accessors are skipped unless you ask for them.

The comments DL manages carry facts the index holds, such as how a type is registered in your dependency-injection container; when two projects compile the same unit, each project’s registration is tagged with its name, so one project never overwrites the other’s. Empty tags and parameter skeletons are never written. From the command line nothing is written until you add --apply, and a backup is kept.

Document it · Document unit · Document project · document-all

02 — Keep

Comments that stay true

A generated comment that guesses is worse than none: it reads as authoritative, and nobody checks it. That is why DL writes only what it can show from the index, and why it keeps checking afterwards. A comment that was right last year can be wrong today. doc-drift compares a comment with the code it documents and reports the difference: a <param> naming a parameter the routine no longer declares, or an <exception cref> for an exception that neither the routine nor any routine a few calls below it raises, library calls included.

The 8 documentation lint rules report public declarations with no comment, summaries left as placeholders or that read like a declaration, a <param> with no description, and comments that have drifted, and the drift rule can repair what it finds. Find Undocumented lists the symbols still missing a comment, by kind or visibility.

doc-drift · Find Undocumented · Exception facts in the editor · The lint rules

03 — Share

Documentation outside the IDE

An API reference site. drag-lint site (since 1.60) writes a plain HTML reference of one project from its index: a hub with every unit, class and interface and a search box, and a page for each of them with its doc comment, its members and one chart. Open it from disk or copy the folder to any web server; the same index gives the same files, byte for byte.

A browsable wiki. Export to Obsidian writes the indexed project out as a set of Markdown pages, one vault you can read without Delphi.

Your team’s own words. A dl:wiki block in a doc comment names a concept, such as “the scheduler”, and drag-lint wiki routes that phrase to the code that implements it, which is where a new developer starts. It can also list every topic, or check them all.

For your AI assistant. Good comments pay twice. Through the MCP server an assistant reads a symbol’s documentation directly, and the context bundle it asks for before changing a symbol includes the doc comment, so the intent you wrote down reaches the assistant along with the code.

For testers. Forms for testers writes a CSV with one row per form, telling a tester how to reach each form from the main form. Unit Test Stub writes a test skeleton for one symbol.

site · Article: an API reference from the index · Export to Obsidian ·wiki · Forms for testers · Unit Test Stub · Article: teach DL your domain words

04 — Charts

Charts and reports

Documentation also means pictures of how the code hangs together. Dependencies, call butterflies, layer diagrams and change impact come as charts and as text. The Reports submenu in RAD Studio and drag-lint ask answer the same chart questions, and a row in a chart opens its line in RAD Studio. The IDE shows each chart as a tab of a dockable drag-lint Chart window; without the Microsoft Edge WebView2 Runtime it opens in the browser.

Chart questions · Layer diagram · Graph viewer · drag-lint Chart window · Charts for change impact

The same commands document the source of HTR Micronite, the production software we build DL alongside.