Auto-attach debugger to node child processes #33148
szszoke
started this conversation in
Feature Ideas / Enhancements
Replies: 1 comment
-
It seems that it's also a must have to make the debugger compatible with SST |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
There is a feature of VS Code called JavaScript Debug Terminal. It looks like a regular terminal but (almost) any running
node
process will start debugger session in VS Code.You can read more here: https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_javascript-debug-terminal
This is implemented via a bootloader script: https://github.com/microsoft/vscode-js-debug/blob/main/src/targets/node/bootloader.ts
The terminal uses the
NODE_OPTIONS
environment cariable to pass a--require
argument for the bootloader script, which then talks to VS Code via a pipe to open a debugging session.This effectively creates a debugging session for any
node
process in the terminal, so to avoid noise, the bootloader tries to ignore some instances bases on command like arguments (likenpm install
).This feature would be useful to for scenarios where a
node
process is often restarted during development, lile restarting a server if the files change.It is also just more convenient to start a process and get a debugger session immediately without having to configure anything.
Beta Was this translation helpful? Give feedback.
All reactions