Skip to content

Commit 43b7fe6

Browse files
committed
separate list names
1 parent edaae3a commit 43b7fe6

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

lib/iex/lib/iex/autocomplete.ex

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -609,24 +609,24 @@ defmodule IEx.Autocomplete do
609609
end
610610

611611
defp match_modules(hint, elixir_root?) do
612-
modules =
612+
loaded =
613613
for mod <- :erlang.loaded(),
614614
str = Atom.to_string(mod),
615615
String.starts_with?(str, hint),
616616
do: str
617617

618-
modules =
619-
if elixir_root? and String.starts_with?("Elixir.Elixir", hint),
620-
do: ["Elixir.Elixir" | modules],
621-
else: modules
622-
623-
modules =
618+
from_apps =
624619
case :code.get_mode() do
625-
:interactive -> modules ++ match_modules_from_applications(hint)
626-
_otherwise -> modules
620+
:interactive -> match_modules_from_applications(hint)
621+
_otherwise -> []
627622
end
628623

629-
:lists.usort(modules)
624+
elixir =
625+
if elixir_root? and String.starts_with?("Elixir.Elixir", hint),
626+
do: ["Elixir.Elixir"],
627+
else: []
628+
629+
:lists.usort(elixir ++ loaded ++ from_apps)
630630
end
631631

632632
defp match_modules_from_applications(hint) do

0 commit comments

Comments
 (0)