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

Add debug support in Test Explorer #29

Merged
merged 1 commit into from
Dec 26, 2024
Merged

Conversation

mnoah1
Copy link
Collaborator

@mnoah1 mnoah1 commented Dec 24, 2024

Add debug support to the test explorer.

When this feature is enabled (via bazelbsp.debug.enabled setting), an additional debug run option will appear on each test item.

Overall flow:

  • When a debug button for a test case is clicked, run is trigged as usual, with added additionalBazelParams (now supported by bazel-bsp server). These flags are configurable based on bazelbsp.debug.bazelFlags and should include any flags needed to get Bazel to build and launch the target in debug mode.
  • As the build runs, messages are watched for a debug ready message. The pattern to watch for is configurable in bazelbsp.debug.readyPattern.
  • Finally, once the pattern is matched, the VS Code launch configuration is triggered. This allows use of an existing launch configuration in the workspace (which can be set via settings, workspace, launch.json, etc), configurable via bazelbsp.debug.launchConfigName.

If any of the settings are not properly set, the run will still attempt to proceed but print a warning in the output.

@mnoah1 mnoah1 changed the title Add debug support Add debug support in Test Explorer Dec 24, 2024
Copy link
Collaborator

@shuklahy shuklahy left a comment

Choose a reason for hiding this comment

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

LGTM

@shuklahy shuklahy self-assigned this Dec 26, 2024
@shuklahy shuklahy marked this pull request as ready for review December 26, 2024 15:28
@mnoah1 mnoah1 merged commit 0c2fd00 into uber:main Dec 26, 2024
4 checks passed
@mnoah1 mnoah1 deleted the add-debug-support branch December 26, 2024 20:26
@shuklahy shuklahy mentioned this pull request Jan 2, 2025
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