From 3a397e840943ba9380df5fee393140e7c45116af Mon Sep 17 00:00:00 2001 From: Yevhen Vydolob Date: Mon, 10 Apr 2023 12:23:10 +0300 Subject: [PATCH] Add vscode launch config to debug extension Signed-off-by: Yevhen Vydolob --- .vscode/launch.json | 29 +++++++++++++++++++++++++++++ scripts/run.mjs | 8 ++++++++ 2 files changed, 37 insertions(+) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..b9b0235 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,29 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Debug Podman-Desktop Process", + "skipFiles": ["/**"], + "program": "${workspaceFolder}/scripts/run.mjs", + "resolveSourceMapLocations": [ + "${workspaceFolder}/**", + "!**/node_modules/**" + ], + "sourceMaps": true, + "args": ["debug"], + "autoAttachChildProcesses": true + }, + { + // Needs to start "Debug Podman-Desktop Process" first + "name": "Attach Debugger to Main Process", + "request": "attach", + "type": "node", + "port": 9223, + "sourceMaps": true, + "timeout": 30000 + }, + ], +} + diff --git a/scripts/run.mjs b/scripts/run.mjs index f3f5488..4c1e918 100644 --- a/scripts/run.mjs +++ b/scripts/run.mjs @@ -100,6 +100,11 @@ async function run() { await exec('yarn', ['watch'], {cwd: desktopPath}); } +async function debug() { + exec('yarn', ['watch'], {cwd: path.join(__dirname, '..')}); + await exec('yarn', ['watch', '--extension-folder', path.join(__dirname, '..')], {cwd: desktopPath}); +} + const firstArg = process.argv[2]; switch(firstArg) { @@ -110,6 +115,9 @@ switch(firstArg) { case 'run': await run(); break; + case 'debug': + await debug(); + break; case 'prepare' : default: