Skip to content

Commit f9cb812

Browse files
author
José Valim
committed
Always use the loaded application modules
Signed-off-by: José Valim <[email protected]>
1 parent f8711f2 commit f9cb812

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lib/iex/lib/iex/autocomplete.ex

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,17 @@ defmodule IEx.Autocomplete do
188188
end
189189

190190
defp modules_as_lists(true) do
191-
modules = ["Elixir.Elixir"] ++ modules_as_lists(false)
192-
modules = if :code.get_mode() === :interactive do
193-
modules ++ loaded_applications_as_lists
194-
end
195-
Enum.uniq(modules)
191+
["Elixir.Elixir"] ++ modules_as_lists(false)
196192
end
197193

198194
defp modules_as_lists(false) do
199-
Enum.map(:code.all_loaded, fn({m, _}) -> Atom.to_string(m) end)
195+
modules = Enum.map(:code.all_loaded, fn({m, _}) -> Atom.to_string(m) end)
196+
197+
if :code.get_mode() === :interactive do
198+
Enum.uniq(modules ++ loaded_applications_as_lists())
199+
else
200+
modules
201+
end
200202
end
201203

202204
defp loaded_applications_as_lists do

0 commit comments

Comments
 (0)