Describe the bug
In a codeblock with multiple debugger() statements, the highlighting is inconsistent.
To Reproduce
Steps to reproduce the behavior:
flutter createmain.dart, replace _incrementCounter() with:void _incrementCounter() {
print(0);
debugger(); //1
print(1);
setState(() {
print(2);
debugger(); //2
print(3);
_counter++;
print(4);
});
print(5);
debugger(); //3
print(6);
}
Expected behavior
On pressing the floating action button
Line with //1 should be highlighted first (and highlighted), followed by //2 and //3 on continuing twice respectively.
Screenshots




Versions (please complete the following information):
Turns out, that it doesn't highlight the last debugger() in the codeblock, but in the whole file!
An easy workaround is to have a non-empty when, so, for example, use debugger(when:true)
Thanks for the report! I can repro this, though only on web - so I think it may be a DWDS issue (it provides the information to understand the location of where the debugger pauses). I've filed this over at https://github.com/dart-lang/webdev/issues/1292 with some additional info from the debugger logs that will hopefully help fix. Please subscribe to that issue if you'd like updates.
Thanks!
My apologies, I should've mentioned the only web part.
No problem, I suspected it might be web (there's a lot of complicated mapping that goes on for web). Looks like it's not DWDS, the original source map generated by ddc may be wrong, so I've filed https://github.com/dart-lang/sdk/issues/45544 about this.
Most helpful comment
No problem, I suspected it might be web (there's a lot of complicated mapping that goes on for web). Looks like it's not DWDS, the original source map generated by ddc may be wrong, so I've filed https://github.com/dart-lang/sdk/issues/45544 about this.