From 0b17a5f3fb8a3fa2d991ecc62a0d4949875f7395 Mon Sep 17 00:00:00 2001 From: sam hoang Date: Tue, 4 Feb 2025 00:39:03 +0700 Subject: [PATCH 1/2] feat: make easy to run debug mode --- .vscode/launch.json | 18 +++++++++--------- .vscode/tasks.json | 36 +++++++++++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 10 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index ead1700291..a7e8c580a5 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,20 +10,20 @@ "type": "extensionHost", "request": "launch", "runtimeExecutable": "${execPath}", - "args": [ - "--extensionDevelopmentPath=${workspaceFolder}", - ], + "args": ["--extensionDevelopmentPath=${workspaceFolder}"], "sourceMaps": true, "outFiles": ["${workspaceFolder}/dist/**/*.js"], - "preLaunchTask": "compile", + "preLaunchTask": "debug-mode", "env": { "NODE_ENV": "development", "VSCODE_DEBUG_MODE": "true" }, - "resolveSourceMapLocations": [ - "${workspaceFolder}/**", - "!**/node_modules/**" - ] - }, + "resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"], + "presentation": { + "hidden": false, + "group": "tasks", + "order": 1 + } + } ] } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 5804f54cd6..1c037cddb1 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -7,7 +7,6 @@ "label": "compile", "type": "npm", "script": "compile", - "dependsOn": ["npm: build:webview"], "group": { "kind": "build", "isDefault": true @@ -29,6 +28,41 @@ "isDefault": false } }, + { + "label": "debug-mode", + "dependsOn": ["compile", "npm: dev"], + "group": { + "kind": "build", + "isDefault": false + }, + "dependsOrder": "parallel", + "presentation": { + "reveal": "always", + "panel": "new" + } + }, + { + "type": "npm", + "script": "dev", + "group": "build", + "problemMatcher": { + "owner": "vite", + "pattern": { + "regexp": "^$" + }, + "background": { + "activeOnStart": true, + "beginsPattern": ".*VITE.*", + "endsPattern": ".*Local:.*" + } + }, + "isBackground": true, + "label": "npm: dev", + "presentation": { + "group": "watch", + "reveal": "never" + } + }, { "type": "npm", "script": "build:webview", From 51f5f10974e5b03f72d5eb24e762c50ee3815d38 Mon Sep 17 00:00:00 2001 From: cte Date: Mon, 3 Feb 2025 09:52:21 -0800 Subject: [PATCH 2/2] PR feedback --- .vscode/tasks.json | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 1c037cddb1..4b49a7859f 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -42,6 +42,7 @@ } }, { + "label": "npm: dev", "type": "npm", "script": "dev", "group": "build", @@ -57,63 +58,46 @@ } }, "isBackground": true, - "label": "npm: dev", "presentation": { "group": "watch", "reveal": "never" } }, { + "label": "npm: build:webview", "type": "npm", "script": "build:webview", "group": "build", "problemMatcher": [], "isBackground": true, - "label": "npm: build:webview", "presentation": { "group": "watch", "reveal": "never" } }, { + "label": "npm: watch:esbuild", "type": "npm", "script": "watch:esbuild", "group": "build", "problemMatcher": "$esbuild-watch", "isBackground": true, - "label": "npm: watch:esbuild", "presentation": { "group": "watch", "reveal": "never" } }, { + "label": "npm: watch:tsc", "type": "npm", "script": "watch:tsc", "group": "build", "problemMatcher": "$tsc-watch", "isBackground": true, - "label": "npm: watch:tsc", "presentation": { "group": "watch", "reveal": "never" } - }, - { - "type": "npm", - "script": "watch-tests", - "problemMatcher": "$tsc-watch", - "isBackground": true, - "presentation": { - "reveal": "never", - "group": "watchers" - }, - "group": "build" - }, - { - "label": "tasks: watch-tests", - "dependsOn": ["npm: watch", "npm: watch-tests"], - "problemMatcher": [] } ] }