From c4a47efe7a7f25310fa9cdd26d2f92c11b81e192 Mon Sep 17 00:00:00 2001 From: Benedikt Scheffbuch Date: Tue, 8 Apr 2025 11:57:52 +0200 Subject: [PATCH 1/2] Fix vscode launch.json in debugging.md - Add comment descriptions - Link to VSCode docs Signed-off-by: Benedikt Scheffbuch --- docs/tooling/local-dev/debugging.md | 33 ++++++++++++++++------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/docs/tooling/local-dev/debugging.md b/docs/tooling/local-dev/debugging.md index 65354442b2..16b65d159c 100644 --- a/docs/tooling/local-dev/debugging.md +++ b/docs/tooling/local-dev/debugging.md @@ -52,26 +52,29 @@ The resulting log should now have more information available for debugging: ### VSCode -In your `launch.json`, add a new entry with the following, +In your `.vscode/launch.json`, add a new entry with the following, ```jsonc { - "name": "Start Backend", - "type": "node", - "request": "launch", - "cwd": "${workspaceFolder}", - "runtimeExecutable": "yarn", - "args": [ - "start-backend", - "--inspect" - ], - "skipFiles": [ - "/**" - ], - "console": "integratedTerminal" -}, + "configurations": [ + { + "name": "Start Backstage", // The name of this configuration, displayed in the Run and Debug panel. + "type": "node", // Specifies that this is a Node.js debugging configuration. + "request": "launch", // Indicates that the debugger should launch the application (as opposed to attaching to an already running process). + "cwd": "${workspaceFolder}", // Sets the current working directory to the root of the workspace. + "runtimeExecutable": "yarn", // Specifies the runtime to execute the application. In this case, it uses `yarn` to run the script. + "args": ["dev", "--inspect"], // Arguments passed to the `yarn` command. Here, it runs `yarn dev` with the `--inspect` flag to enable debugging. + "skipFiles": ["/**"], // Tells the debugger to skip stepping into Node.js internal files during debugging. + "console": "integratedTerminal" // Specifies that the debugger should use the integrated terminal for input/output. + } + ] +} ``` +You can add multiple configurations for different purposes. + +See the [VSCode docs](https://code.visualstudio.com/docs/debugtest/debugging-configuration) for more information. + ### WebStorm This section describes the process for enabling run configurations for Backstage in WebStorm. From bfb84b7d035e7d77dcb22650d513f2d1f71c2c4a Mon Sep 17 00:00:00 2001 From: Benedikt Scheffbuch Date: Wed, 9 Apr 2025 08:28:17 +0200 Subject: [PATCH 2/2] chore(docs): Update docs/tooling/local-dev/debugging.md to include new default start script Co-authored-by: Patrik Oldsberg Signed-off-by: Benedikt Scheffbuch --- docs/tooling/local-dev/debugging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tooling/local-dev/debugging.md b/docs/tooling/local-dev/debugging.md index 16b65d159c..2629ce4f75 100644 --- a/docs/tooling/local-dev/debugging.md +++ b/docs/tooling/local-dev/debugging.md @@ -63,7 +63,7 @@ In your `.vscode/launch.json`, add a new entry with the following, "request": "launch", // Indicates that the debugger should launch the application (as opposed to attaching to an already running process). "cwd": "${workspaceFolder}", // Sets the current working directory to the root of the workspace. "runtimeExecutable": "yarn", // Specifies the runtime to execute the application. In this case, it uses `yarn` to run the script. - "args": ["dev", "--inspect"], // Arguments passed to the `yarn` command. Here, it runs `yarn dev` with the `--inspect` flag to enable debugging. + "args": ["start", "--inspect"], // Arguments passed to the `yarn` command. Here, it runs `yarn start` with the `--inspect` flag to enable debugging. "skipFiles": ["/**"], // Tells the debugger to skip stepping into Node.js internal files during debugging. "console": "integratedTerminal" // Specifies that the debugger should use the integrated terminal for input/output. }