Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve VS Code debugger support #18057

Merged
merged 1 commit into from
Aug 15, 2024
Merged

Improve VS Code debugger support #18057

merged 1 commit into from
Aug 15, 2024

Conversation

Rylan12
Copy link
Member

@Rylan12 Rylan12 commented Aug 15, 2024

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run 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 add binding.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 correct rdbg executable with HOMEBREW_RDBG set. Setting this variable tells bin/brew that it's okay to pass RUBY_DEBUG_* configuration variables to the filtered environment (as this is the easiest way to use the existing rdbg VS Code extension).

Finally, I removed the --stop option from brew 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.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, nice work @Rylan12!

@Rylan12 Rylan12 merged commit f3a6aef into master Aug 15, 2024
24 checks passed
@Rylan12 Rylan12 deleted the rdbg-followup branch August 15, 2024 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants