diff --git a/.gitignore b/.gitignore index 5a055cbbfa3e..9e3b1e4d0674 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ node_modules .turbo .vscode +!.vscode/launch.json .pnpm-* /temp .idea diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000000..0f3e1d56201a --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,21 @@ +{ + "version": "0.2.0", + "configurations": [ + { + // Start LLD with: + //ELECTRON_ARGS=--remote-debugging-port=8315 pnpm dev:lld + "name": "Attach Electron Renderer", + "type": "chrome", + "request": "attach", + "port": 8315 + }, + { + // Start LLD with: + //LEDGER_INTERNAL_ARGS=--inspect pnpm dev:lld + "name": "Attach Electron Main", + "type": "node", + "request": "attach", + "skipFiles": ["/**"] + } + ] +} diff --git a/apps/ledger-live-desktop/README.md b/apps/ledger-live-desktop/README.md index dc8b254aa0d0..2410bde54bc1 100644 --- a/apps/ledger-live-desktop/README.md +++ b/apps/ledger-live-desktop/README.md @@ -79,41 +79,27 @@ pnpm build:lld ## Debug -If you are using [Visual Studio Code](https://code.visualstudio.com/) IDE, here is a [Launch Configuration](https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_launch-configuration) that should allow you to run and debug the main process as well as the render process of the application. - -As stated in the [debugging documentation](https://code.visualstudio.com/docs/editor/debugging), this file should be named `launch.json` and located under the `.vscode` folder at the root of the monorepository. +If you are using [Visual Studio Code](https://code.visualstudio.com/) IDE, we provide a [default debug configuration](https://github.com/LedgerHQ/ledger-live/tree/develop/.vscode/launch.json) that you can use to debug the main and renderer processes of the application. ```json { "version": "0.2.0", - "compounds": [ - { - "name": "Run and Debug LLD", - "configurations": ["Debug Main Process", "Debug Renderer Process"], - "stopAll": true - } - ], "configurations": [ { - "name": "Debug Main Process", - "type": "node", - "request": "launch", - "cwd": "${workspaceFolder}", - "runtimeExecutable": "pnpm", - "args": ["dev:lld"], - "outputCapture": "std", - "resolveSourceMapLocations": null, - "env": { - "ELECTRON_ARGS": "--remote-debugging-port=8315" - } + // Start live desktop with: + //ELECTRON_ARGS=--remote-debugging-port=8315 pnpm dev:lld + "name": "Attach Electron Renderer", + "type": "chrome", + "request": "attach", + "port": 8315 }, { - "name": "Debug Renderer Process", - "type": "chrome", + // Start live desktop with: + //LEDGER_INTERNAL_ARGS=--inspect pnpm dev:lld + "name": "Attach Electron Main", + "type": "node", "request": "attach", - "address": "localhost", - "port": 8315, - "timeout": 60000 + "skipFiles": ["/**"] } ] } @@ -121,7 +107,7 @@ As stated in the [debugging documentation](https://code.visualstudio.com/docs/ed ### Tips -- #### **Can't find Node.js binary "pnpm": path does not exist. Make sure Node.js is installed and in your PATH, or set the "runtimeExecutable" in your launch.json*** +- #### **Can't find Node.js binary "pnpm": path does not exist. Make sure Node.js is installed and in your PATH, or set the "runtimeExecutable" in your launch.json\*** Add your terminal PATH as enviroment variable.