bazel-contrib / bazel-contrib/vscode-bazel
Add debugger integration for other languages
- Dominant language
- TypeScript
- Stars
- 296
- Forks
- 108
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 5
Description
# Feature Request: Add debugger integration for other languages
While it is possible to debug starlark and BUILD files using this extension it would be incredibly useful to be able to automatically generate debug configs for non-starlark targets.
## Example use-case:
A cc_test "//:flaky_test" is flaky, and difficult to to track why it is sometimes flaky. I would like to be able to step over this executable using a debugger.
*vscode-bazel would:*
1. Compile the //:flaky_test with --compilation_mode dbg
2. Generate a vscode debugger config that runs the executable using gdb or other debuggers
3. Runs the executable using vscodes builtin debugger (using the relevant extension for the language e.g. cppdbg)
This would require some fairly flexible configuration in order to it to be useful for the range of rules that bazel supports e.g. rust, java, cpp, swift etc.
Perhaps some method of templating the json debugger configurations that come with bazel would make this feature flexible enough that it could be used for a generic project.
## Why
It becomes quite tedious to manually add the debug configurations for every new target. Further because of how bazel sandboxes work, the executable simlink often disappears when building another successive target. So sometimes running another command after the inital build can result in the first executable disappearing, and therefore debugging no longer works as expected. Having some level of automation here would be awesome.
Contributor guide
Research direction
Start by locating the existing debugger integration for Starlark and BUILD files; the issue names no source files or tests to begin with. Define how non-Starlark targets such as C++, Rust, Java, and Swift would be selected, built, and mapped to VS Code debugger configurations, with completion shown by an automated configuration that launches a target such as //:flaky_test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100