- You need to add
--debug
to any command you wanted to run. - Waiting for the text
Observatory listening on http://127.0.0.1:8181/xxxxxxx=/
- Don't forget to put breakpoints in your
dangerfile.dart
-
Open
.vscode/launch.json
or create one if you don't have it. -
Add following configuration
{ "name": "Danger Attach", "type": "dart", "request": "attach", "program": "tool/dangerfile.dart" }
Note: It doesn't have to point to your
dangerfile.dart
, any dart file inside folderbin
ortool
in your workspace should be fine. More detail -
Press
Run
onDanger Attach
inRun and Debug
tab -
VSCode will ask for
VM Service URI
- It will start at
yourdangerfile.dart.g.dart
, you can skip it
- Go to
Run
>Edit Configurations...
- Press
+
button and selectDart Remote Debug
- Put 'Debug Danger' into name field, and press
OK
- On the main window, select
Debug Danger
and pressDebug
- It will ask for
VM Service URI
- It will start at
yourdangerfile.dart.g.dart
, you can skip it