Fathom.Tracer (fathom v0.1.0)

Copy Markdown View Source

Compiler tracer that records every resolved reference in the project.

Pass it to the compiler with --tracer Fathom.Tracer. The compiler invokes trace/2 after macro expansion, so what lands in the database is what use, import and framework macros actually generated, not the surface syntax. A use Phoenix.LiveView that expands into a dozen callbacks produces a dozen definitions here.

Everything runs inside the compiler's processes, so each clause does the minimum work needed to build a tuple and hand it to Fathom.Facts.

The caller of a top-level reference

References in a module body have no enclosing function. They are attributed to the pseudo-function __compile__/0 on that module, which is also how they are distinguished from runtime references when deriving module dependencies: anything reached from __compile__/0 is a compile-time dependency.