create-adapter icon indicating copy to clipboard operation
create-adapter copied to clipboard

[enhancement] add launch.json to vscode

Open mcm1957 opened this issue 1 year ago • 6 comments

It should be evaluated wetehr adding a launch.json to the vscode template directory is a good idea. I'll add an example which seems to work as base for discussion. Whter "launch install" should be added or removed is to be discussed too. It a special variant to debug installation situations which could possibly confuse newbies.

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch normal",
            "program": "${workspaceFolder}/main.js",
            "args": ["--instance", "0", "--force", "--logs", "--debug"],
            "env": {
                NODE_PATH=".dev-server\default\node_modules"
            },
            "request": "launch",
            "stopOnEntry": true,
            "console": "internalConsole",
            "outputCapture": "std",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "type": "node"
        },
    
        {
            "name": "Launch install",
            "program": "${workspaceFolder}/main.js",
            "args": ["--instance", "0", "--force", "--logs", "--debug", "--install"],
            "env": {
                NODE_PATH=.dev-server\default\node_modules
            },
            "request": "launch",
            "stopOnEntry": true,
            "console": "internalConsole",
            "outputCapture": "std",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "type": "node"
        },
    
        {
            "name": "Attach by Process ID",
            "processId": "${command:PickProcess}",
            "request": "attach",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "type": "node"
        }
    ]
}

I can try to add if some consent exists that it is useful

See telegram disussion too https://t.me/c/1697676361/5198 and several messages before and after ...

mcm1957 avatar Aug 11 '23 15:08 mcm1957

Should be:

NODE_PATH=".dev-server/default/node_modules"

Schmakus avatar Aug 11 '23 18:08 Schmakus

Thanks - updated

mcm1957 avatar Aug 11 '23 18:08 mcm1957

Thanks - updated

Also Launch Install and / instead \

Schmakus avatar Aug 11 '23 19:08 Schmakus

Bei mir funktioniert beim Remote Debugging auch folgendes:

       {
            "type": "node",
            "request": "attach",
            "name": "Attach to remote",
            "restart": true,
            "port": 9229,
            "resolveSourceMapLocations": [
                "${workspaceFolder}/.dev-server/default/node_modules/**/*.js"
            ]
        },

ticaki avatar Aug 19 '23 07:08 ticaki

A not yet released version of dev-server enables using symlinks for installing the adapter. This includes two launch configs (one for TS, one for JS): https://github.com/ioBroker/dev-server/pull/357

I'd prefer releasing that new version, make symlinking the default and use those launch configs.

Adding the one-time-install launch config may be helpful though.

AlCalzone avatar Aug 20 '23 12:08 AlCalzone

corrected code from 1st Post:

{
	"version": "0.2.0",
	"configurations": [
		{
			"name": "Launch normal",
			"program": "${workspaceFolder}/main.js",
			"args": ["--instance", "0", "--force", "--logs", "--debug"],
			"env": {
				"NODE_PATH": ".dev-server/default/node_modules"
			},
			"request": "launch",
			"stopOnEntry": true,
			"console": "internalConsole",
			"outputCapture": "std",
			"skipFiles": ["<node_internals>/**"],
			"type": "node"
		},

		{
			"name": "Launch install",
			"program": "${workspaceFolder}/main.js",
			"args": ["--instance", "0", "--force", "--logs", "--debug", "--install"],
			"env": {
				"NODE_PATH": ".dev-server/default/node_modules"
			},
			"request": "launch",
			"stopOnEntry": true,
			"console": "internalConsole",
			"outputCapture": "std",
			"skipFiles": ["<node_internals>/**"],
			"type": "node"
		},

		{
			"name": "Attach by Process ID",
			"processId": "${command:PickProcess}",
			"request": "attach",
			"skipFiles": ["<node_internals>/**"],
			"type": "node"
		}
	]
}

Standarduser avatar Oct 14 '23 14:10 Standarduser