I believe that `@doc false' is used as an indication that a function, while 
accessible from outside the module, is not supposed to be `publically' used 
by consumers of the module.
So this behaviour is expected, and the best way to resolve this situation 
is probably to just add some descriptive documentation to the changeset 
function.

I can totally understand that this behaviour might feel somewhat 
counter-intuitive, however.
There is a related discussion going on about this right now over here 
(proposal: protected/private modules) 
<https://groups.google.com/forum/#!topic/elixir-lang-core/nTPCTRQ6Ljg>. 

On Wednesday, December 20, 2017 at 10:51:29 AM UTC+1, Milad Rastian wrote:
>
> I've noticed in Elixir 1.5 we don't autocomplete functions that have @doc 
> false.
>
> For example if I create a module like this
>
> defmodule MyApp.Accounts.User do
>   use Ecto.Schema
>   import Ecto.Changeset
>   alias MyApp.Accounts.User
>
>
>   schema "users" do
>     field :age, :integer
>     field :name, :string
>
>     timestamps()
>   end
>
>   @doc false
>   def changeset(%User{} = user, attrs) do
>     user
>     |> cast(attrs, [:name, :age])
>     |> validate_required([:name, :age])
>   end
> end
>
> And now if I try to use it in iex, I won't get autocompletion suggestion 
> for changeset function.
>
> iex(1)> MyApp.Accounts.User.<with pressing TAB, iex doesn't suggest 
> changeset>
>
>
> I believe this behavior is changed since this PR 
> https://github.com/elixir-lang/elixir/pull/6131
>
> In terms of user experience is a bit unexpected that in the above example 
> I have a public function changeset and I can't get suggestion it in IEx. I 
> use IEx regularly when I want to check something quickly and it happened to 
> me few times so far and I was really confused why I can't get suggestion 
> for my public function.
>
>
> Looking forwards to hear your opinions
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/87e1fe7e-e5f0-4fc7-a0ec-91fa9506fdab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to