Skip to content

Commit 6399ea3

Browse files
committed
keep OTP 22 compatibility until elixir 1.13 is supported
1 parent 8fb2b11 commit 6399ea3

File tree

1 file changed

+17
-6
lines changed
  • apps/debug_adapter/lib/debug_adapter

1 file changed

+17
-6
lines changed

apps/debug_adapter/lib/debug_adapter/server.ex

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2353,13 +2353,24 @@ defmodule ElixirLS.DebugAdapter.Server do
23532353
end
23542354
end)
23552355

2356-
for {module_charlist, _beam_path, _loaded} <- :code.all_available(),
2357-
module = List.to_atom(module_charlist),
2358-
module_name = inspect(module),
2359-
Enum.any?(regexes, fn regex ->
2356+
if String.to_integer(System.otp_release()) >= 23 do
2357+
for {module_charlist, _beam_path, _loaded} <- :code.all_available(),
2358+
module = List.to_atom(module_charlist),
2359+
module_name = inspect(module),
2360+
Enum.any?(regexes, fn regex ->
2361+
Regex.match?(regex, module_name)
2362+
end) do
2363+
module
2364+
end
2365+
else
2366+
# TODO remove when we drop OTP 22 and elixir 1.13 support
2367+
ElixirSense.all_modules()
2368+
|> Enum.filter(fn module_name ->
2369+
Enum.find(regexes, fn regex ->
23602370
Regex.match?(regex, module_name)
2361-
end) do
2362-
module
2371+
end)
2372+
end)
2373+
|> Enum.map(fn module_name -> Module.concat(Elixir, module_name) end)
23632374
end
23642375
|> interpret_modules(exclude_module_pattern)
23652376
end

0 commit comments

Comments
 (0)