vscode-rdbg
vscode-rdbg copied to clipboard
Apply `useBundler` configuration option to `rdbg`
When running a launch command, the logs indicate the useBundler option is being applied to the user-provided command, but not to rdbg itself, e.g.
rdbg -- bundle exec /project/bin/rails test /project/test/example_test.rb
rather than
bundle exec rdbg -- bundle exec /project/bin/rails test /project/test/example_test.rb.
This presents a problem when trying to use a fork of ruby/debug in a Gemfile, e.g. for troubleshooting or development purposes:
- The system-installed gem loads first, so any changes in the fork to the initialization process are not applied.
- Less critically, when the forked gem loads it generates warnings for things being overwritten. Such as:
/home/spin/.bundle/pos-compliance-server/bundler/gems/debug-2e5a1864dd3f/lib/debug/config.rb:4: warning: already initialized constant DEBUGGER__::LOG_LEVELS /opt/rubies/ruby-3.2.0/lib/ruby/gems/3.2.0/gems/debug-1.7.1/lib/debug/config.rb:4: warning: previous definition of LOG_LEVELS was here
Pretty confusing but it turns out useBundler is ignored if your launch config has a "command": specified.