You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In prelude.rb, we use defined?(::DEBUGGER__) to check if debug/session has been loaded, which would have defined Kernel#debugger.
But it's also possible to have ::DEBUGGER__ defined and NOT having debug/session loaded, like require "debug/config", which we have in one of our gems.
It requires debug/config because we want to configure the debugger with these requirements:
The configuration can happen before/after require "debug", as we're not in control of gems' loading order.
We want to configure it in Ruby code.
So we have something like this:
require"debug/config"sorbet_paths=Gem.loaded_specs["sorbet-runtime"].full_require_paths.freeze# skip Sorbet related frames/backtrace when debuggingDEBUGGER__::CONFIG[:skip_path]=Array(DEBUGGER__::CONFIG[:skip_path]) + sorbet_paths
But that triggers prelude.rb's early return 😢
Therefore, I wonder if it's possible to make the condition a bit stricter, like if defined?(::DEBUGGER__::Session)?
The text was updated successfully, but these errors were encountered:
Your proposal
In
prelude.rb
, we usedefined?(::DEBUGGER__)
to check ifdebug/session
has been loaded, which would have definedKernel#debugger
.But it's also possible to have
::DEBUGGER__
defined and NOT havingdebug/session
loaded, likerequire "debug/config"
, which we have in one of our gems.It requires
debug/config
because we want to configure the debugger with these requirements:require "debug"
, as we're not in control of gems' loading order.So we have something like this:
But that triggers
prelude.rb
's early return 😢Therefore, I wonder if it's possible to make the condition a bit stricter, like
if defined?(::DEBUGGER__::Session)
?The text was updated successfully, but these errors were encountered: