VirtualTimeGenServer.ModuleReferences (GenServerVirtualTime v1.0.1)

Copy Markdown View Source

Finds the modules a source tree refers to.

Reads .ex and .exs files and reports every remote call and struct literal with the module it names, the function it calls and where it appears. Files that do not parse are reported instead of failing the run: a project that does not compile is exactly when this is useful.

Summary

Functions

Scans every file below each path (or the file itself) and collects its references, in source order.

Types

module_reference()

@type module_reference() :: %{
  module: String.t(),
  function: String.t() | nil,
  file: Path.t(),
  line: pos_integer()
}

result()

@type result() :: %{references: [module_reference()], unparsable: [Path.t()]}

Functions

scan(paths)

@spec scan([Path.t()]) :: result()

Scans every file below each path (or the file itself) and collects its references, in source order.