Utilities for inspecting Ash DSL constructs in source AST.
Summary
Functions
Returns all explicit action entity AST nodes within an actions section.
Returns true if an actions section defines any actions, explicitly or via defaults.
Returns true if the AST node is a call to an Ash.* module (e.g. Ash.read!/2).
Returns all Ash.* API call AST nodes found in the source file, resolving aliases lexically.
Returns all Ash.* API call AST nodes found in the source file together with
their alias-expanded module segments, normalized call arguments, visible
alias mappings, and straight-line local bindings.
Returns all Ash.* API call AST nodes found in the source file together with
their alias-expanded module segments as {call_ast, expanded_module_segments} tuples.
Returns true if the source file or module contains use Ash.Domain.
Returns true if the source file or module contains use Ash.Resource.
Extracts the action entries declared in a defaults [...] call.
Checks whether a defaults call sets an action type to a specific value.
Returns all modules in the source file that directly use Ash.Domain.
Returns true if the resource uses data_layer: :embedded.
Returns all entity AST nodes of a given name within a section.
Extracts the body statements from an entity's do block.
Checks if a keyword option is set to a specific value in an entity's opts or do block.
Checks if a keyword option is declared inline or inside the entity's do block.
Extracts the first atom argument from an entity call (e.g. action name).
Extracts keyword options from an entity AST call.
Expands module alias segments using alias mappings returned by module_aliases/2.
Finds the AST node for a top-level DSL section (e.g. :attributes) in a module AST or resource/domain context.
Searches inside an entity's do block for a call matching call_name.
Returns the line number of a use call for the given module aliases.
Returns true if the resource declares a non-embedded data layer in use Ash.Resource.
Checks if an entity call exists inside a section AST node.
Returns top-level alias mappings in a module body, optionally only those declared before a given line.
Returns the flattened list of top-level statements inside a module body.
Returns the line span of a module AST, if end metadata is available.
Returns true if a module reference resolves to the given module segments.
Returns normalized option values with line numbers from inline opts and do blocks.
Returns normalized option values from inline opts and do blocks.
Returns all policy and bypass entities from a policies section, including inside policy_group.
Resolves a module reference within a module or resource context.
Returns shared resource metadata for a resource module.
Returns resource contexts for all resource modules in the source file, in file order.
Returns the value of the resource's data_layer option, if present.
Returns the best issue anchor line for a resource section, falling back to the use line and then fallback.
Returns all modules in the source file that directly use Ash.Resource.
Finds a top-level DSL section from a resource context.
Returns the flattened list of statements inside a section body.
Returns true if a section contains at least one DSL entry.
Returns the best issue anchor line for a section, falling back to line and then fallback.
Returns the line number of a section's opening.
Extracts keyword options from a use call matching the given module aliases.
Functions
Returns all explicit action entity AST nodes within an actions section.
Returns true if an actions section defines any actions, explicitly or via defaults.
Returns true if the AST node is a call to an Ash.* module (e.g. Ash.read!/2).
Returns all Ash.* API call AST nodes found in the source file, resolving aliases lexically.
Returns all Ash.* API call AST nodes found in the source file together with
their alias-expanded module segments, normalized call arguments, visible
alias mappings, and straight-line local bindings.
Each result is a map with keys :call_ast, :expanded_module, :args,
:aliases, and :bindings.
Returns all Ash.* API call AST nodes found in the source file together with
their alias-expanded module segments as {call_ast, expanded_module_segments} tuples.
Returns true if the source file or module contains use Ash.Domain.
Returns true if the source file or module contains use Ash.Resource.
Extracts the action entries declared in a defaults [...] call.
Checks whether a defaults call sets an action type to a specific value.
Returns all modules in the source file that directly use Ash.Domain.
Returns true if the resource uses data_layer: :embedded.
Returns all entity AST nodes of a given name within a section.
Extracts the body statements from an entity's do block.
Checks if a keyword option is set to a specific value in an entity's opts or do block.
Checks if a keyword option is declared inline or inside the entity's do block.
Extracts the first atom argument from an entity call (e.g. action name).
Extracts keyword options from an entity AST call.
Expands module alias segments using alias mappings returned by module_aliases/2.
Finds the AST node for a top-level DSL section (e.g. :attributes) in a module AST or resource/domain context.
Searches inside an entity's do block for a call matching call_name.
Returns the line number of a use call for the given module aliases.
Returns true if the resource declares a non-embedded data layer in use Ash.Resource.
Checks if an entity call exists inside a section AST node.
Returns top-level alias mappings in a module body, optionally only those declared before a given line.
Returns the flattened list of top-level statements inside a module body.
Returns the line span of a module AST, if end metadata is available.
Returns true if a module reference resolves to the given module segments.
Returns normalized option values with line numbers from inline opts and do blocks.
Returns normalized option values from inline opts and do blocks.
Returns all policy and bypass entities from a policies section, including inside policy_group.
Resolves a module reference within a module or resource context.
Returns shared resource metadata for a resource module.
Returns resource contexts for all resource modules in the source file, in file order.
Returns the value of the resource's data_layer option, if present.
Returns the best issue anchor line for a resource section, falling back to the use line and then fallback.
Returns all modules in the source file that directly use Ash.Resource.
Finds a top-level DSL section from a resource context.
Returns the flattened list of statements inside a section body.
Returns true if a section contains at least one DSL entry.
Returns the best issue anchor line for a section, falling back to line and then fallback.
Returns the line number of a section's opening.
Extracts keyword options from a use call matching the given module aliases.