Skip to content

Complex types formatting #799

@wojtekmach

Description

@wojtekmach

Currently it's only broken on |, and so e.g. on complex structs it looks like this:

zrzut ekranu 2017-11-26 o 18 36 35

(https://hexdocs.pm/ecto/Ecto.Changeset.html#t:t/0)

Ideally, we'd get back something similar to what formatter can do:

iex> IO.puts Code.format_string!("t() :: %Ecto.Changeset{action: action, changes: %{optional(atom) => term}, constraints: [constraint], data: Ecto.Schema.t | map | nil, empty_values: term, errors: [{atom, error}], filters: %{optional(atom) => term}, params: %{optional(String.t) => term} | nil, prepare: [(t -> t)], repo: atom | nil, repo_opts: Keyword.t, required: [atom], types: nil | %{optional(atom) => Ecto.Type.t}, valid?: boolean, validations: Keyword.t}")
t() :: %Ecto.Changeset{
  action: action,
  changes: %{optional(atom) => term},
  constraints: [constraint],
  data: Ecto.Schema.t() | map | nil,
  empty_values: term,
  errors: [{atom, error}],
  filters: %{optional(atom) => term},
  params: %{optional(String.t()) => term} | nil,
  prepare: [(t -> t)],
  repo: atom | nil,
  repo_opts: Keyword.t(),
  required: [atom],
  types: nil | %{optional(atom) => Ecto.Type.t()},
  valid?: boolean,
  validations: Keyword.t()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions