Skip to content

Commit

Permalink
make sure modules from erts are returned
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson committed Oct 14, 2023
1 parent 497d9b7 commit 5587135
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/elixir_sense/core/applications.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ defmodule ElixirSense.Core.Applications do
@spec get_modules_from_applications() :: [module]
# TODO use :code.all_available |> Enum.map(fn {m, _, _} -> :"#{m}" end) on otp 23+
# as it returns more
# NOTE this function does not return modules from :erts app as it is not loaded
def get_modules_from_applications do
# :erts app is not loaded by default
Application.load(:erts)

for [app] <- loaded_applications(),
{:ok, modules} = :application.get_key(app, :modules),
module <- modules do
Expand Down
1 change: 1 addition & 0 deletions test/elixir_sense/all_modules_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ defmodule ElixirSense.Providers.ModulesTest do
assert "ElixirSense.Providers" not in modules
assert "ElixirSense.Providers.Definition" in modules
assert ":kernel" in modules
assert ":erlang" in modules
end
end
1 change: 1 addition & 0 deletions test/elixir_sense/core/erlang_html_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ defmodule ElixirSense.Core.ErlangHtmlTest do
:eldap,
:erl_docgen,
:erl_interface,
:erts,
:et,
:eunit,
:ftp,
Expand Down

0 comments on commit 5587135

Please sign in to comment.