# `Igniter.Refactors.Rename`
[🔗](https://github.com/ash-project/igniter/blob/v0.8.3/lib/igniter/refactors/rename.ex#L5)

Refactors for renaming things in a project

# `rename_function`

```elixir
@spec rename_function(
  Igniter.t(),
  old :: {module(), atom()},
  new :: {module(), atom()},
  opts :: Keyword.t()
) :: Igniter.t()
```

Renames a function globally across a project.

## Options

- `:arity` - `:any` | integer | [integer]. The arity or arities of the function to rename. Defaults to `:any`.
- `:deprecate` - `:soft | :hard`. Leave the original function in place, but with a deprecation.
  Soft deprecations appear in documentation but do not cause warnings. Hard deprecations warn when they are called.

# `rename_module`

```elixir
@spec rename_module(Igniter.t(), module(), module(), Keyword.t()) :: Igniter.t()
```

Renames a module globally across a project.

Renames the module everywhere it appears: `defmodule`, `alias`, `use`,
`import`, `require`, and all call sites. Also handles submodules, the
corresponding test module, string literals mentioning the module name, and
moves the file(s) to match the new module's proper location.

## Alias handling

- `alias Foo.Bar` — the alias declaration and all `Bar.*` call sites are renamed.
- `alias Foo.{Bar, Other}` — the declaration and call sites are renamed.
  Spitfire does not macro-expand the brace form, so resolution falls back to
  an explicit AST scan.
- `alias Foo.Bar, as: B` — only the declaration is updated (`alias Foo.Baz, as: B`).
  `B.*` call sites are left untouched because the `as:` clause still resolves correctly.

## Limitations

- Dynamic references (e.g. `apply/3`, `Module.concat/2` with variables) are not rewritten.
- String-literal replacement is a plain substring replace over the raw file content,
  so it also rewrites occurrences in comments and unrelated strings. Grep after.

# `subsume_module_attrs`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
