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

Test: transition of "auto attach" feature to new js-debug JavaScript terminal #96296

Closed
2 tasks done
weinand opened this issue Apr 27, 2020 · 1 comment
Closed
2 tasks done
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues testplan-item
Milestone

Comments

@weinand
Copy link
Contributor

weinand commented Apr 27, 2020

Refs: #88599

Complexity: 3

Authors: @connor4312, @weinand


VS Code's legacy Node.js debugging supports an "auto attach" feature, which makes the VS Code debugger automatically attach to node.js programs if they were launched from the integrated terminal in debug mode (for details see https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_auto-attach-feature).

The new JavaScript debugger supports an even more elegant auto-attach: node.js programs do not have to be launched in debug mode in order to have the debugger auto attach to it (this is js-debug's new "Node.js Debug Terminal").

To provide a smooth transition experience for existing "auto-attach" users to the new js-debug functionality, we've added code that automatically transitions the "auto-attach" settings to the new settings when the user switches from the current node.js debugger to js-debug.

How to verify:

  • make sure to use the old node.js debugger in VS Code
  • have a simple long running test program, e.g. test.js:
    var i = 0;
    setInterval(() => {
      console.log('hello world ' + i++);
    }, 1000);
  • set a breakpoint on the console.log
  • enable "Auto Attach" via F1
  • run the program from the integrated terminal via node --inspect test.js

VS Code should automatically attach to the program and stop on the breakpoint

  • now switch to the new js-debug by setting debug.node.useV3: true
  • the terminal should show a ⚠️ icon suggesting you update the environment variables; do so
  • launch the program again from the integrated terminal but now via node test.js

VS Code should automatically attach to the program and stop on the breakpoint (but now in the new debugger)

Now verify more cases:

  • enable "Auto Attach" in the old node.js setup
  • switch to the new js-debug
  • stop VS Code
  • start VS Code
  • verify that the "Auto Attach" shows up in the status bar
  • verify that js-debug has not yet been activated
  • run node test.js from the integrated terminal
  • verify that the new debugger attaches automatically

TBD..

@connor4312 please correct anything that I got wrong and add more tests for corner cases you are aware of

@weinand weinand added this to the April 2020 milestone Apr 27, 2020
@weinand weinand added the debug Debug viewlet, configurations, breakpoints, adapter issues label Apr 27, 2020
@joaomoreno joaomoreno assigned joaomoreno and unassigned isidorn Apr 28, 2020
@stevencl stevencl removed their assignment Apr 28, 2020
@joaomoreno
Copy link
Member

@weinand I believe it's node --inspect test.js, instead of --debug. I've updated your instructions.

@joaomoreno joaomoreno removed their assignment Apr 28, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jun 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues testplan-item
Projects
None yet
Development

No branches or pull requests

4 participants