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

Add UI for editing variables #7744

Closed
weinand opened this issue Jun 15, 2016 · 6 comments
Closed

Add UI for editing variables #7744

weinand opened this issue Jun 15, 2016 · 6 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality
Milestone

Comments

@weinand
Copy link
Contributor

weinand commented Jun 15, 2016

I've added a new 'setVariableRequest' and a capability 'supportsSetVariable' to the debug protocol.
If this capability is true, the VS Code debugger should provide a UI gesture to edit the value of leafs in the variable view. The request takes the reference of the variable container, the name of the variable leaf, and the value as arguments. If the request succeeds, the new value is returned and is used as the new value of the variable. In case of failure the error should be shown in the error notification and the old value remains.

This is the UI for microsoft/vscode-debugadapter-node#27

@weinand weinand added feature-request Request for new features or functionality debug Debug viewlet, configurations, breakpoints, adapter issues labels Jun 15, 2016
@weinand weinand added this to the June 2016 milestone Jun 15, 2016
@weinand weinand added the important Issue identified as high-priority label Jun 15, 2016
@isidorn isidorn assigned weinand and unassigned isidorn Jun 16, 2016
@isidorn
Copy link
Contributor

isidorn commented Jun 16, 2016

@weinand please notice that I started with just the context menu action with the 'Set Value' action. This action should only be enalbed for primitive values and only if the debug adapter supports set value.
We can add this behavior on double click aslo if we want in future.

Try it out and let me know what you think.

@weinand
Copy link
Contributor Author

weinand commented Jun 16, 2016

@isidorn works like a charm!

One issue: on success use the body.value as the new value for the variable, not the value passed as an argument.

@weinand weinand removed the important Issue identified as high-priority label Jun 16, 2016
@isidorn
Copy link
Contributor

isidorn commented Jun 16, 2016

@weinand great! Pushed the fix to respect the value returned.

@weinand
Copy link
Contributor Author

weinand commented Jun 17, 2016

@isidorn Another issue: the error returned by setVariableRequest is not yet shown. For now you can show it as an error notification. In the future we could use a similar approach as in the explorer:

2016-06-17_12-19-54

@wesrupert
Copy link

@isidorn It looks like 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.

@isidorn
Copy link
Contributor

isidorn commented Jun 24, 2016

@wesrupert true, can you please create a seperate issue for that. Thank you.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

3 participants