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

[FR]: Pleasant VS Code debugging experience #790

Open
1 task
gonzojive opened this issue Jan 14, 2023 · 0 comments
Open
1 task

[FR]: Pleasant VS Code debugging experience #790

gonzojive opened this issue Jan 14, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@gonzojive
Copy link
Contributor

gonzojive commented Jan 14, 2023

What is the current behavior?

https://github.com/aspect-build/rules_js/blob/main/docs/README.md#debugging describes how to use VS step-through debuggers with rules_js.

There are a few annoying aspects:

  1. Setup is required in .bazelrc and VS Code.
  2. The build target must be launched independently from the VS Code debugger. That is, first the user runs bazel run --config=debug //:foo; then, the user runs launches the "Attach nodejs_binary" configuration.
  3. Due to 2, when the user wants to rerun a program, it takes 30s or so. With typical VS Code debugging, the "Debug: Restart" command can be used (a single button click).
  4. The debugger doesn't recognize breakpoints set in the original source files, and the copies of these source files in bazel-bin are used instead.

Describe the feature

VS Code debugging of bazel targets should be approximately as easy as debugging normal TypeScript/JavaScript projects. I want to specify either a test or binary target, hit the debug button, and debug as usual.


Implementation notes

Perhaps source maps should be emitted when source files are copied to the output, or symlinks to the source directory should be used instead (if supported) when using the debug bazel config.

Documentation on how VS Code's debugger uses source maps:
https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_source-map-discovery

Fund our work

@gonzojive gonzojive added the enhancement New feature or request label Jan 14, 2023
@gregmagolan gregmagolan moved this to 📋 Backlog in Open Source Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant