Skip to content
Browse files

Only show documented functions on autocomplete

Autocompletion is used for discovery by other developers
and we should avoid exposing non documented functions.
  • Loading branch information...
1 parent 9a94970 commit 7a8fa34020fe21305fc8bb203742f6eae27b42d8 @josevalim josevalim committed Oct 25, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/iex/lib/iex/autocomplete.ex
View
6 lib/iex/lib/iex/autocomplete.ex
@@ -238,7 +238,11 @@ defmodule IEx.Autocomplete do
defp get_funs(mod) do
if function_exported?(mod, :__info__, 1) do
- (mod.__info__(:functions) -- [__info__: 1]) ++ mod.__info__(:macros)
+ if docs = mod.__info__(:docs) do
+ lc { tuple, _line, _kind, _sign, doc } inlist docs, doc != false, do: tuple
+ else
+ (mod.__info__(:functions) -- [__info__: 1]) ++ mod.__info__(:macros)
+ end
else
mod.module_info(:exports)
end

4 comments on commit 7a8fa34

@devinus

What? What about during development when you haven't documented everything yet?

@josevalim
Elixir member

That's a good point. Any opinion on how we want to tackle it?

1) Revert this commit
2) Show all functions if __info__(:docs) return []

@devinus

@josevalim Only if it explicitly has @doc false should it be hidden. All other public funs should be shown.

@josevalim
Elixir member

Ah, that's how it works today. So we are good.

Please sign in to comment.
Something went wrong with that request. Please try again.