Debugger: Step to the next line in an async function.
See original GitHub issueDebugging async functions in Dart is super annoying.
I am at line 10. I want to go to line 11:
10 var x = await getSomething(); ➜ I am here
11 print(x); ➜ Just want to go here
But the await
means some other code will have the chance to run, and we go to a completely different part of the code.
If I want to go to line 11, I am forced to add a breakpoint there or “force run” to line 11. That’s painful. Sometimes I don’t even notice there is an await in the middle of the line, and when I try to go the the next line it goes somewhere else and don’t even know where I was anymore. I have to restart and pay double attention, which wastes my brain CPU and makes it harder for me to reason about the code.
I was told by Simon Binder that the Dart VM protocol has a “step to the next line in an async function” command (and that is accessible from the observatory), but somehow all IDEs don’t use that.
Please add this to the debugger.
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (9 by maintainers)
Top GitHub Comments
The problem in the plugin is that
suspendContext.getAtAsyncSuspension()
is returningfalse
. We’ll have to look into it further.@marcglasberg In both VS Code and IntelliJ the “Step Over” function is supposed to do what you want. It’s broken in IntelliJ, but working in VS Code.
Thanks for checking. It was a bug in the Flutter and Dart plugins. Fixed in both now.
On Mon, May 17, 2021 at 7:47 AM Danny Tuppeny @.***> wrote: