Muex.Loader (Muex v0.6.1)

View Source

Loads and parses source files using a language adapter.

The loader discovers source files, filters out test files and other unwanted patterns, and parses them into ASTs using the provided language adapter.

Summary

Functions

Loads source files from the given path pattern using the language adapter.

Loads source files from multiple path patterns.

Types

file_entry()

@type file_entry() :: %{path: String.t(), ast: term(), module_name: atom() | nil}

Functions

load(path_pattern, language_adapter, opts \\ [])

@spec load(String.t(), module(), keyword()) :: {:ok, [file_entry()]}

Loads source files from the given path pattern using the language adapter.

Parameters

  • path_pattern - Directory, file, or glob pattern (e.g., "lib", "lib/*/.ex", "lib/myapp/*.ex")
  • language_adapter - Module implementing Muex.Language behaviour
  • opts - Options:
    • :include - List of glob patterns to include (default: all files with adapter's extensions)
    • :exclude - List of patterns to exclude (default: test files)

Returns

{:ok, files} where files is a list of file_entry maps

load_all(path_patterns, language_adapter, opts \\ [])

@spec load_all([String.t()], module(), keyword()) ::
  {:ok, [file_entry()]} | {:error, term()}

Loads source files from multiple path patterns.