Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetVariable doesn't trigger reevaluation of stale variables #8118

Closed
wesrupert opened this issue Jun 24, 2016 · 5 comments
Closed

SetVariable doesn't trigger reevaluation of stale variables #8118

wesrupert opened this issue Jun 24, 2016 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues *duplicate Issue identified as a duplicate of another issue(s)
Milestone

Comments

@wesrupert
Copy link

  • VSCode Version: 1.3.0-insider, 2016-06-23

Assigning to a variable doesn't prompt a reevaluation of any variables that depend on it. Variables can be stale after setting a variable in languages such as C# (e.g. a property in the locals window), and watch expressions can be stale in all languages since they can be arbitrary expressions dependent on the changed variable.

@dbaeumer dbaeumer added the debug Debug viewlet, configurations, breakpoints, adapter issues label Jun 25, 2016
@dbaeumer dbaeumer added the bug Issue identified by VS Code Team member as probable bug label Jun 25, 2016
@isidorn
Copy link
Contributor

isidorn commented Jun 27, 2016

June to investigate

@isidorn isidorn modified the milestones: June 2016, July 2016 Jun 27, 2016
@wesrupert
Copy link
Author

In general, this issue can be expanded to evaluating any expression. I hadn't even thought of the repl in the debug console, but you can trigger expressions such as a = 3, and a won't update in the locals / watches that depend on a won't reevaluate. I'm not seeing a way for a debug adapter to work around this issue either, since afaik VS Code needs to send a variables request first in order to care about a variables response. VS Code needs to either handle stale expression reevaluation, or add something to the protocol where a debug adapter can notify VS Code that its variable state is stale.

@isidorn
Copy link
Contributor

isidorn commented Jul 8, 2016

Ok I have pushed a fix that the watch expression are always up to date (when evaluting from repl or changing variable values).

Now we have the issue that the local variables can be outaded if an evaluation happens in the repl, or if a variable that is dependent upon is changed via setVariable.
This issue is already captured in #2399 thus closing this as duplicate.

@wesrupert @weinand please comment on that issue with ideas on how to update variables after evaluation. VSCode can send the variables request again (but that seems to heavy to be done on each repl evaluation) - or the adapter could somehow notify vscode that a variables inside locals has updated. I am open for suggestions

@ansyral
Copy link

ansyral commented Sep 5, 2017

@isidorn seems right now the code to trigger an event to re-evaluate expressions in watch window is removed. See setVariable. And if I set a variable, its value in watch window is still out of sync. Any idea about this?

@isidorn
Copy link
Contributor

isidorn commented Sep 5, 2017

@ansyral thanks for pointing this out, I have pushed a fix which takes care of this issue cd79dfc

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues *duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

4 participants