question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DAP Scopes aren't being updated after a variable has changed

See original GitHub issue

Describe the bug variables command on scopes’ variablesReferenceis not updated if the values of the variables had changed (For example, watch evaluation or variable set). It does work however on an object’s variablesReference and the bug is specific to scopes.

To Reproduce Reproducing with setVariable is tougher and requires sending DAP packets by hand (When setting a variable, VSCode doesn’t fetch the entire variables but uses the returned result from the setVariable request), but the easiest way would be the following using VSCode watches:

  1. Debug the following code:
let a = 1
let b = 2
let c = 3
let d = {"m_1":1, "m_2":2}
console.log("Hello world!\n") // <= Place breakpoint here
  1. Place a single watch: eval("a = 8") - see that it doesn’t update the value of a.
  2. Place another watch: eval("d.m_1 = 20") - see that it indeed updates!
  3. Behind the scenes: After evaluating a watch, VSCode requests again for the scopes and variables of the current frame, upon which a returns with the un-updated value while d.m_1 is.

Log File

No log file is required, as it is easy to reproduce.

VS Code Version: 1.72.0

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
connor4312commented, Oct 12, 2022

Ah, indeed. They have responded positively to the new issue though.

0reactions
gfszrcommented, Oct 12, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Support for indicating custom debug focus change · Issue #128
A client cannot use this event to track any runtime changes of a variable. The event only says that the current "snapshot" of...
Read more >
Debug Adapter Protocol - Microsoft Open Source
Debug adapters can use this event to indicate that the contents of a memory range has changed due to some other request like...
Read more >
Scope value not updating when service variable changes
I've a component (parms-bar.component.js) which is supposed to update when I click on the button (box.component.js), but it's not happening. I'm ...
Read more >
Debugging
Debugging. The Go extension allows you to launch or attach to Go programs for debugging. You can inspect variables and stacks, set breakpoints, ......
Read more >
[vscode-go] docs/dlv-dap: add features and images
+To opt in to use this new adapter (`dlv-dap`), add the following in ... variables, setting breakpoints, and other activities that aren't ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found