Open mnoah1 opened 1 year ago
/cc @hyangah for any feedback on supporting run/debug for Bazel.
@hyangah @jamalc - Just wanted to see if you have any feedback on this issue? We have a working version on our fork and wanted to confirm that you would be interested in having me submit a PR?
Interestingly enough, this need not be a bazel specific thing. Rather, vscode-go could be made a somewhat more flexible:
bazel run run_under="dlv -l $MY_DAP_ADDR --headless exec" -c dbg //bazel/target -- args
. Should not be difficult to implement, will take care of the most pressing need.bazel info output_base
will return a path for the bazel build dir. vscode-go should simply provide a hook allowing to invoke this sort of pre-launch task and an ability to produce a bunch of substitute-path
items out of it. To my opinion, making vscode-go work with bazel like build system does not seem like a major undertaking and it's a pity something like this was not done already.
Is your feature request related to a problem? Please describe. Our team uses Bazel with our Go projects. Currently, this extension is able to discover tests but the run/debug functionalities do not work correctly since they run
go
commands instead of Bazel.Describe the solution you'd like Allow customizable user option to use Bazel to run/debug tests. Override a few of the methods in GoTestRunner with an alternate implementation that runs the Bazel version of the needed command. Add parsing of Bazel build events to report pass/fail status.
Describe alternatives you've considered 1) Add this to the Bazel for VS Code extension - not ideal because that extension is more focused on Starlark / BUILD file creation, and does not offer language-specific Go support or integration with VS Code's testing API. 2) Create a separate extension that depends on several of the classes in this vs-code extension, and sets up an alternate version of the
GoTestExplorer
with the missing Bazel functionality. Users that wish to use this functionality could then turn off the test explorer setting on this extension, then run the separate extension side-by-side with this one. Not ideal due to the overhead of maintaining a separate extension / project where only a few areas of functionality actually differ.Additional context Would also be open to any other general feedback about how other teams are supporting Run/Debug functionality in the IDE for Bazel users (other than command line, which is our current state).