mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-11-10 17:15:09 +08:00
Do not crash on missing exports, closes #2400
This commit is contained in:
parent
9ce18a3df8
commit
bf44cb8cdf
1 changed files with 10 additions and 3 deletions
|
@ -707,9 +707,16 @@ defmodule Livebook.Intellisense.IdentifierMatcher do
|
|||
end
|
||||
|
||||
defp exports(mod, node) do
|
||||
for {fun, arity} <- :erpc.call(node, mod, :module_info, [:exports]),
|
||||
not reflection?(fun, arity),
|
||||
do: function_or_macro(Atom.to_string(fun), fun, arity)
|
||||
try do
|
||||
:erpc.call(node, mod, :module_info, [:exports])
|
||||
rescue
|
||||
_ -> []
|
||||
else
|
||||
exports ->
|
||||
for {fun, arity} <- exports,
|
||||
not reflection?(fun, arity),
|
||||
do: function_or_macro(Atom.to_string(fun), fun, arity)
|
||||
end
|
||||
end
|
||||
|
||||
defp reflection?(:module_info, 0), do: true
|
||||
|
|
Loading…
Reference in a new issue