Debugger shows multiple versions of a shadowed variable in locals when running on the web
- Dominant language
- Dart
- Stars
- 224
- Forks
- 94
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 2
Description
When debugging with vscode.
```dart
main() {
var x = 40;
if (x > 10) {
var x = 'hello';
if (x.isNotEmpty) {
var x = Duration.zero;
print(x);
}
}
}
```
Observe the local variables in the debugger pane.
VM:
Web:
Getting the shadowed variable using expression evaluation works as expected though.
Contributor guide
Research direction
Reproduce the nested shadowing example in VS Code and compare the VM and web debugger locals panes, then trace the web debugger's local-variable handling. No source file or test is named in the issue. Done means the web locals present the shadowed variables consistently with the expected debugger behavior while expression evaluation continues to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, vscode
- Domain
- devtools, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100