`__schema__` is only a partially-public API. For it to show up in
documentation and iex, a PR would need to be accepted to Ecto that would
add a `@doc` attribute to the generated `def __schema__(…)` code.

I just did the following test, and iex acts exactly as it should:

```
defmodule TestApp do
  def __test__, do: :test
end
```

In iex, `TestApp.<tab>` does not complete.

```
defmodule TestApp do
  @doc "The secret __test__ function"
  def __test__, do: :test
end
```

In iex, `TestApp.<tab>` completes to `TestApp.__test__`.

-a

On Wed, Sep 6, 2023 at 4:02 PM thibaut...@gmail.com <
thibaut.barr...@gmail.com> wrote:

> Hi!
>
> Today during a session I was caught a bit off-guard by the fact that
> completion doesn't tell you about __schema__ on an Ecto module.
>
> (although the behaviour is clearly documented in IEx
> https://github.com/elixir-lang/elixir/blob/1bc8bc5e76e20c6b0180e024e9d280ab5fc0af94/lib/iex/lib/iex.ex#L22-L26
> ).
>
> I feel this is a bit sad in terms of "discoverability" for newcomers to
> Ecto in that case, since __schema__ is a public API of Ecto (
> https://hexdocs.pm/ecto/Ecto.Schema.html#module-reflection).
>
> I wonder if this is an isolated example or if there are more cases that
> could affect newcomers to a given Elixir library, and how we could make
> this more approchable for newcomers?
>
> Let me know what you think!
>
> -- Thibaut
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elixir-lang-core+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/3fbfc0f6-a7f0-4635-b4d1-32f1417d350dn%40googlegroups.com
> <https://groups.google.com/d/msgid/elixir-lang-core/3fbfc0f6-a7f0-4635-b4d1-32f1417d350dn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Austin Ziegler • halosta...@gmail.com • aus...@halostatue.ca
http://www.halostatue.ca/http://twitter.com/halostatue

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAJ4ekQtMRn1RCuAJajhhz8fybCX%3DJZCggCUNGULnAmmrZ8k1yA%40mail.gmail.com.

Reply via email to