revali dev runs your construct inside a compiled runner, so breakpoints in your construct are not hit. To debug, launch the runner's source file,
.dart_tool/revali/revali.dart, from your IDE instead. Run dart run revali dev
once first so the file exists.
In VS Code, add a launch configuration in the server project:
.vscode/launch.json
{
"configurations": [
{
"name": "Debug constructs",
"request": "launch",
"type": "dart",
"cwd": "${workspaceFolder}",
"program": ".dart_tool/revali/revali.dart",
"args": ["dev"]
}
]
}
-
argsselects the mode, exactly as on the command line:["dev"]or["build"], plus any flags such as--flavor. -
Set
cwdto the server project root, the directory holding itspubspec.yaml. -
Breakpoints in your construct package's
lib/now work, and you can inspect theMetaServerthat Revali built, which is the quickest way to learn what the analyzer exposes for your routes.
revali.dart is regenerated when the set of constructs changes. If you add or remove a construct, run
dart run revali dev again before debugging.