diff --git a/docs/developer-guide.md b/docs/developer-guide.md index 404895106de97..f76429d3d4553 100644 --- a/docs/developer-guide.md +++ b/docs/developer-guide.md @@ -22,6 +22,7 @@ http://ecotrust-canada.github.io/markdown-toc/ * [Configure system variables](#configure-system-variables) * [Start the playground with RiseDev](#start-the-playground-with-risedev) * [Start the playground with cargo](#start-the-playground-with-cargo) +- [Debug playground using vscode](#debug-playground-using-vscode) - [Develop the dashboard](#develop-the-dashboard) * [Dashboard v1](#dashboard-v1) * [Dashboard v2](#dashboard-v2) @@ -197,6 +198,10 @@ Then, connect to the playground instance via: psql -h localhost -p 4566 -d dev -U root ``` +## Debug playground using vscode + +To step through risingwave locally with a debugger you can use the `launch.json` and the `tasks.json` provided in `vscode_suggestions`. After adding these files to your local `.vscode` folder you can debug and set breakpoints by launching `Launch 'risingwave p' debug`. + ## Develop the dashboard Currently, RisingWave has two versions of dashboards. You can use RiseDev config to select which version to use. diff --git a/vscode_suggestions/launch.json b/vscode_suggestions/launch.json new file mode 100644 index 0000000000000..0f1e7e2db9f76 --- /dev/null +++ b/vscode_suggestions/launch.json @@ -0,0 +1,17 @@ +{ + "version": "0.2.0", + "configurations": [ + { + // Use this if you want to debug risedev p locally + "name": "Launch playground debug", + "type": "lldb", + "request": "launch", + "program": "${workspaceRoot}/target/debug/risingwave", + "args": [ + "playground" + ], + "cwd": "${workspaceRoot}", + "preLaunchTask": "build rw bin" + } + ] +} \ No newline at end of file diff --git a/vscode_suggestions/tasks.json b/vscode_suggestions/tasks.json new file mode 100644 index 0000000000000..8ff31f45f1c36 --- /dev/null +++ b/vscode_suggestions/tasks.json @@ -0,0 +1,14 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build rw bin", + "type": "shell", + "command": "/bin/bash", + "args": [ + "-c", + "risedev k ; cargo build --bin risingwave" + ] + } + ] +} \ No newline at end of file