Delphi-RAG-Lint
← DL (drag-lint) · Find and navigate

Ask the code. Get the exact answer.

Text search finds every place a word appears: comments, strings and every other routine that happens to share the name. DL answers from the parsed code instead. You get the declaration, the callers that really call this routine, and the unit that really declares this type.

Every answer comes from the index on your machine, in the same form on the command line, in RAD Studio, in your editor and for your AI assistant.

01 — Symbols

Where is it, and what is it?

Find a declaration. query --name finds where a symbol is declared; Symbol Search does the same across all your indexed projects. In RAD Studio, Go to Definition and Go to Implementation take the caret straight there.

See it without opening it. The hover card shows the signature, the type, the documentation and the callers of the symbol under the caret; an interface method also lists the classes that implement it. Class Surface shows a class’s members and signatures without the method bodies, and outline lists what one unit contains.

Everything about one symbol at once. context returns a compact bundle: its doc comment, the class surface, its own body and a capped list of callers. It is exactly what you, or an AI assistant, need before changing it.

Symbol Search · Hover at cursor · Go to Definition · Class Surface · context

02 — Calls and uses

Who calls it, and what does it call?

DL find-callers query output

Callers, from the call graph

A routine’s callers by name, or only the precise, resolved callers when a name is shared.

find-callers help →

Callers and callees. query find-callers lists who calls a routine; with the precise option it keeps only the calls the index resolved to this exact routine, not to a namesake. find-callees lists what a routine calls, including the calls that go into the library. The reverse call tree follows callers of callers to the depth you choose.

Every use, readers and writers apart. usages finds every reference in one of four scopes: this exact symbol, the project, the project group or everywhere. usages --rw splits the users of a property or field into readers and writers and names the route: property, field, getter, setter or direct. Inc/Dec and var or out arguments of resolved calls count as writes.

find-callees · Reverse call tree · usages · Find Usages in the IDE

03 — Types and interfaces

Who implements this interface?

The interface report lists every class that implements an interface, how it does so (directly, through a derived interface, inherited or delegated) and which method answers each interface method, method resolution clauses and implements delegation included. You get it on the command line, as a chart, as Go to Implementation and as a code lens.

Class hierarchies work both ways: query ancestors walks up from a type, query descendants lists every class below an ancestor across all indexed databases, and helpers-of finds the record and class helpers for a type. Show Wiring surfaces what the compiler does not make obvious: Spring4D container registrations and the event hookups in form files.

Interface implementors · query descendants · Show Wiring · Article: who implements this interface

04 — Text, units and errors

Where does this message come from?

Any text, in code and forms. query --text finds a message, a caption or a piece of SQL across .pas, .dfm and .sql files. With --near it keeps only the hits in routines a few calls away from a symbol you name, so a common word stops drowning the answer.

The unit to add to uses. find-unit tells you which indexed unit declares a symbol and can add it to a file’s uses clause for you; in RAD Studio it is a quick fix on the undeclared identifier.

Your own words. Concept search ranks symbols by the words in identifiers and doc comments, so a phrase like “customer discount” finds the code even when no identifier spells it exactly.

Where an error comes from. exception-facts lists which routines raise and which handle each exception type, so you can see where an error starts before you decide where to catch it.

query --text --near · find-unit · Concept search · exception-facts · Article: add the missing uses unit · Article: which routine raises this exception

We ask these questions every day while building HTR Micronite, our production-control software, which is where DL learned to answer them quickly on a large code base.