-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
debug: enable js-debug to auto attach #95807
Conversation
This modifies the debug-auto-launch extension to trigger js-debug as outlined in #88599 (comment) Since we now have four states, I moved the previous combinational logic to a `transitions` map, which is more clear and reliable. The state changes are also now a queue (in the form of a promise chain) which should avoid race conditions. There's some subtlety around how we cached the "ipcAddress" and know that environment variables are set. The core desire is being able to send a command to js-debug to set the environment variables only if they haven't previously been set--otherwise, reused the cached ones and the address. This process (in `getIpcAddress`) would be vastly simpler if extensions could read the environment variables that others provide, though there may be security considerations since secrets are sometimes stashed (though I could technically implement this today by manually creating and terminal and running the appropriate `echo $FOO` command). This seems to work fairly well in my testing. Fixes #88599.
See microsoft/vscode#95807 for details
See microsoft/vscode#95807 for details
When trying to use this PR I see the issue that js-debug does not automatically start debugging when setting "debug.node.useV3" to true. Here are the steps:
Observe:
Observe: I would have expected that js-debug would automatically attach. The version of the Nightly js-debug is 2020.4.1517. In addition I see this error:
|
The changes into js-debug are still in a PR, I haven't merged/published them yet in case there were any structural changes coming out of this PR. Here's a vsix of that branch, you can install it manually to test this: https://memes.peet.io/img/debug-terminal-js-debug-nightly.vsix |
Yep, with that vsix all my scenarios work just fine. Great stuff. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code looks good to me. Just one typo to fix.
See microsoft/vscode#95807 for details
This modifies the debug-auto-launch extension to trigger js-debug as
outlined in #88599 (comment)
Since we now have four states, I moved the previous combinational logic
to a
transitions
map, which is more clear and reliable. The statechanges are also now a queue (in the form of a promise chain) which
should avoid race conditions.
There's some subtlety around how we cached the "ipcAddress" and know
that environment variables are set. The core desire is being able to
send a command to js-debug to set the environment variables only if they
haven't previously been set--otherwise, reused
the cached ones and the address.
This process (in
getIpcAddress
) would be vastly simpler if extensionscould read the environment variables that others provide, though there
may be security considerations since secrets are sometimes stashed
(though I could technically implement this today by manually creating
and terminal and running the appropriate
echo $FOO
command).This seems to work fairly well in my testing. Fixes #88599.
/cc @isidorn @roblourens