diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 778d88032..7c0ca4f19 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -69,6 +69,15 @@ the issue or issues that your changes address. - [vadimcn.vscode-lldb](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb) 2. Open `Command Palette` with Ctrl+Shift+P or F1 and type `LLDB: Generate Launch Configurations from Cargo.toml` then select it, this will generate a file that should be saved as `.vscode/launch.json`. +You may also want to enable debugging by creating a `.vscode/settings.json` file: + ```json + { + "rust-analyzer.runnables.extraEnv": { + "CARGO_PROFILE_DEV_DEBUG": true + } + } + ``` + since this repo has `debug = 0` in the root `Cargo.toml` to speed up compilation. 3. Now you can enable breakpoint on code through IDE and then start debugging the library/binary you want, such as the following example: diff --git a/contributor-book/src/getting-started/configuring-your-editor.md b/contributor-book/src/getting-started/configuring-your-editor.md index 3c879270e..601a43d66 100644 --- a/contributor-book/src/getting-started/configuring-your-editor.md +++ b/contributor-book/src/getting-started/configuring-your-editor.md @@ -25,6 +25,15 @@ To use the debugger, follow these steps: that should be saved as `.vscode/launch.json`. 2. Select the configuration from the "run and debug" side panel, then select the target from the list. + You may also want to enable debugging by creating a `.vscode/settings.json` file: + ``` + { + "rust-analyzer.runnables.extraEnv": { + "CARGO_PROFILE_DEV_DEBUG": true + } + } + ``` + since this repo has `debug = 0` in the root `Cargo.toml` to speed up compilation. 3. Now you can enable breakpoints on code through IDE then start debugging the library/binary you want, like in the following example: