Multiple `debugger();` statements in a codeblock messes up highlighting.
See original GitHub issueDescribe the bug
In a codeblock with multiple debugger()
statements, the highlighting is inconsistent.
To Reproduce Steps to reproduce the behavior:
- create the hello world app with
flutter create
- In
main.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);
}
- Run (with or without debugging, it doesn’t matter)
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
Ran the project(on web):
Clicked the FAB:
Pressed continue:
Pressed continue:
Versions (please complete the following information):
- VS Code version: 1.54.3 (Universal)
- Dart extension version: 3.20.1
- Dart/Flutter SDK version: Channel stable, 2.0.1, on macOS 11.2.3 20D91 darwin-x64
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Common problems and solutions - Code::Blocks
1 I cannot use the debugger. 1.1 Problem; 1.2 Solution. 2 Multi-targets library and executable ignore interdependence.
Read more >A case against syntax highlighting - Linus Åkesson
But as we know, professional syntax highlighting almost never colors two words next to each other in different colors, it colors the key...
Read more >Debugger arrow and highlighting is missing
During debugging Visual Studio used to show a yellow arrow on the left side and ... but there's no arrow and statement is...
Read more >Syntax - Neovim docs
Syntax highlighting enables Vim to show parts of the text in another font or ... SpecialComment special things inside a comment Debug debugging...
Read more >Are you writing print() statements to debug your Python code?
I was one such person who used to debug code using print() statements. Some times, if the code is lengthy, then there are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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!