-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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
Watch: allow to set value of expressions #115063
Comments
If I understand this correctly: this is a feature request to add a "Set Value" context menu action to the Watch view. |
Yes, it is correct.
|
I've quickly checked what VS is doing: VS knows whether an expression (column "name") is an "lvalue" and can be assigned to. In the screenshot from above the context menu's "Edit Value" command is disabled on the second row because the expression In VS Code we do not know whether an expression is an "lvalue", so using So I suggest that we should try to introduce a "Set Value" context menu command that uses the /cc @gregg-miskelly |
I started investigating into this and created this PR which proves it is possible #127162 Some open questions:
I am not aware of a debug adapter that supports the Edit: C# supports setExpression |
@isidorn thanks for prototyping this!
Postponing this work is perfectly fine because for June it was only planned to investigate this feature. |
As a reference, here is how Eclipse does to determine if an expression is editable (using GDB)
If "attributes" contains Here, for example, expressions 2, 3, and expression's child of Might we need to return a |
Great, thanks for feedback! |
@isidorn sure, I will do this! |
@weinand In case it isn't obvious, VS knows if something is an l-value or not by looking at the |
@isidorn I have reimplemented variables in Mock Debug. See https://github.com/microsoft/vscode-mock-debug/tree/main/sampleWorkspace#variables for details. |
Same as #124679 (comment) |
@isidorn I've finished the implementation of Here is a demo: I 'm seeing one issue: when setting a new value for a watch, the watch isn't updated in the WATCHES view but everywhere else. I'm returning the new value from the And we should consider to respect the |
@weinand good catches. Thanks! The watches
|
@isidorn I've verified that I'm returning a correct body from And this body is correctly received in VS Code: |
Related to : #45621 ?
Hi,
I create this request to implement setExpression in VS Code. Since it already supports well "evaluateName", it would be easy to support this in "Watch" view.
In my mind, if debuggee supports setExpression, you could set a value by double-clicking in current one, or by a "Set Expression..." action.
Regards.
The text was updated successfully, but these errors were encountered: