Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

don't set runtime debug options when port attribute is specified #98

Closed
weinand opened this issue Apr 10, 2017 · 0 comments
Closed

don't set runtime debug options when port attribute is specified #98

weinand opened this issue Apr 10, 2017 · 0 comments
Assignees
Labels

Comments

@weinand
Copy link
Contributor

weinand commented Apr 10, 2017

while testing the MERN tour microsoft/vscode#22277:

node2 exhibits different behaviour when a "port" attribute is specified.

Here is the use case:

I want to create a launch config that uses a locally installed "nodemon" (from the node_modules folder of the project). For this I have to make sure that the "--debug=12345" argument is not passed as a runtime argument to the first instance of node that runs 'nodemon' but that is is passed as an argument to the nodemon.js program (which passes it to the second instance of node).

So the difference is basically this:

node nodemon.js --debug=12345 test.js

instead of:

node --debug=12345 nodemon.js test.js

According to the documentation this can be achieved by specifying an explicit "port" attribute:

If you specify a debug port via the port attribute, VS Code will not automatically add the --debug-brk=nnnn attribute because the debug port is typically specified by the npm script or other tool as well.

A corresponding launch config that works for 'legacy' is this:

{
	"type": "node",
	"request": "launch",
	"name": "Launch Program",
	"runtimeArgs": [
		"${workspaceRoot}/node_modules/nodemon/bin/nodemon.js",
                "--debug=12345"
	],
	"program": "${workspaceRoot}/test.js",
	"port": 12345
},

This results in the following command:

node ...nodemon.js --debug-brk=12345 index.js 

With 'inspector' the result is:

node --inspect=12345 --debug-brk ...nodemon.js --debug-brk=12345 index.js

So the problem is that node-debug2 adds the "--inspect=12345 --debug-brk" to the runtime arguments even if a port is specified.

@weinand weinand added the bug label Apr 10, 2017
@weinand weinand changed the title don't set debug options when port attribute is specified don't set runtime debug options when port attribute is specified Apr 10, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants