You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Andre Weinand (@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.
Isidor Nikolic (@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:
Isidor Nikolic (@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.
Activity
isidorn commentedon Jun 16, 2016
Andre Weinand (@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 commentedon Jun 16, 2016
Isidor Nikolic (@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.
debug: use the body.value as the new value for the variable
isidorn commentedon Jun 16, 2016
Andre Weinand (@weinand) great! Pushed the fix to respect the value returned.
weinand commentedon Jun 17, 2016
Isidor Nikolic (@isidorn) Another issue: the error returned by
setVariableRequestis 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:wesrupert commentedon Jun 23, 2016
Isidor Nikolic (@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 commentedon Jun 24, 2016
Wes Rupert (@wesrupert) true, can you please create a seperate issue for that. Thank you.