Igniter.Code.Module (igniter v0.1.6)

Utilities for working with Elixir modules

Summary

Functions

Given a suffix, returns a module name with the prefix of the current project

The module name prefix based on the mix project's module name

Moves the zipper to the body of a module that uses the provided module (or one of the provided modules).

Moves the zipper to the use statement for a provided module.

Parses a string into a module name

Returns the idiomatic file location for a given module

Functions

Link to this function

module_name(suffix)

@spec module_name(String.t()) :: module()

Given a suffix, returns a module name with the prefix of the current project

Link to this function

module_name_prefix()

@spec module_name_prefix() :: module()

The module name prefix based on the mix project's module name

Link to this function

move_to_def(zipper, fun, arity)

Link to this function

move_to_defp(zipper, fun, arity)

Link to this function

move_to_module_using(zipper, one_of_modules)

@spec move_to_module_using(Sourceror.Zipper.t(), module() | [module()]) ::
  {:ok, Sourceror.Zipper.t()} | :error

Moves the zipper to the body of a module that uses the provided module (or one of the provided modules).

Link to this function

move_to_use(zipper, module)

Moves the zipper to the use statement for a provided module.

Link to this function

parse(module_name)

@spec parse(String.t()) :: module()

Parses a string into a module name

Link to this function

proper_location(module_name)

@spec proper_location(module()) :: Path.t()

Returns the idiomatic file location for a given module