>
> Now that Elixir 1.6 has a *@deprecated* attribute, can we disable 
> autocomplete in IEx only for functions that have *@deprecated* associated 
> to function definitions?


I agree with hiding *@deprecated *functions, but not the *@doc false* ones.

On Thursday, January 4, 2018 at 1:22:02 PM UTC-2, Milad Rastian wrote:
>
> Now that Elixir 1.6 has a *@deprecated* attribute, can we disable 
> autocomplete in IEx only for functions that have *@deprecated* associated 
> to function definitions?
>
> What do you think?
>
> On Thursday, December 21, 2017 at 5:57:26 AM UTC+1, 
> [email protected] wrote:
>>
>> 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/e87c066c-ce01-4468-9581-9ac2daaf26d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to