Skip to content

Commit

Permalink
workaround a crash due to race conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson committed Feb 10, 2024
1 parent 8d6079f commit 62bbda5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/elixir_sense/core/introspection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ defmodule ElixirSense.Core.Introspection do
def get_exports(module) do
case Code.ensure_loaded(module) do
{:module, _} ->
exports =
try do
module.module_info(:exports)
rescue
ArgumentError ->
# in case of race conditions the module might get unloaded
[]
end

for {f, a} <- module.module_info(:exports) do
{f_dropped, a_dropped} = drop_macro_prefix({f, a})

Expand Down

0 comments on commit 62bbda5

Please sign in to comment.