Files
graphify/tests/fixtures/sample.ex
T
Synvoya f2ea6a6087 fix(elixir): expand multi-alias brace form into per-module imports edges
`alias Foo.{Bar, Baz}` (and the same import/require/use brace form) emitted
NO imports edges. tree-sitter-elixir represents it as a `dot` node holding the
base alias plus a trailing `tuple` of member aliases, but the import handler
only matched a bare `alias` child, so every multi-alias import was silently
dropped.

Add `_get_alias_modules`, which expands the brace form to `Foo.Bar`,
`Foo.Baz`, … while leaving the single form (`alias Foo.Bar`) unchanged. Adds a
fixture line + regression test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 11:58:38 +01:00

30 lines
499 B
Elixir

defmodule MyApp.Accounts.User do
@moduledoc """
Handles user accounts and authentication.
"""
alias MyApp.Repo
alias MyApp.Schemas.{Account, Token}
import Ecto.Query
defstruct [:id, :name, :email]
def create(attrs) do
%__MODULE__{}
|> validate(attrs)
|> Repo.insert()
end
def find(id) do
Repo.get(__MODULE__, id)
end
defp validate(user, attrs) do
if Map.has_key?(attrs, :email) do
user
else
{:error, :missing_email}
end
end
end