Improve VS Code debugger support #18057
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?Follow-up to #18050
This PR improves the VS Code launch configuration to work with
brew debugger
to allow you to launch debug sessions directly from VS Code. It also allows you to use the built-in breakpoints feature without needing to manually addbinding.break
.Now, you can choose "Debug Homebrew command" in the VS Code debug tab. This will prompt you to specify a
brew debugger
command to run, defaulting to the basename without extension of the currently open file (to make it easy to debug a certain command if you have its file open). You can change the command and add flags as necessary, and it should remember the last choice that you made with any particular active file.The PR adds an
rdbg
shim which just calls the correctrdbg
executable withHOMEBREW_RDBG
set. Setting this variable tellsbin/brew
that it's okay to passRUBY_DEBUG_*
configuration variables to the filtered environment (as this is the easiest way to use the existingrdbg
VS Code extension).Finally, I removed the
--stop
option frombrew debugger
as I think it just makes sense to have as the default. If there is a location closer to startup that would be useful to debug from, just add a breakpoint using either of the methods. I'm totally open to reverting this part, though, if people would find that useful.