File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed
apps/debug_adapter/lib/debug_adapter Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -2353,13 +2353,24 @@ defmodule ElixirLS.DebugAdapter.Server do
2353
2353
end
2354
2354
end )
2355
2355
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 ->
2360
2370
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 )
2363
2374
end
2364
2375
|> interpret_modules ( exclude_module_pattern )
2365
2376
end
You can’t perform that action at this time.
0 commit comments