Skip to content

Add UI for editing variables #7744

Closed
Closed

Description

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

Activity

  1. added
    feature-request
    debug
    on Jun 15, 2016
  2. added
    important
    on Jun 15, 2016
  3. isidorn commented on Jun 16, 2016

    @isidorn

    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.

  4. weinand commented on Jun 16, 2016

    @weinand
    ContributorAuthor

    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.

  5. removed
    important
    on Jun 16, 2016
  6. isidorn commented on Jun 16, 2016

    @isidorn

    Andre Weinand (@weinand) great! Pushed the fix to respect the value returned.

  7. weinand commented on Jun 17, 2016

    @weinand
    ContributorAuthor

    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:

    2016-06-17_12-19-54

  8. wesrupert commented on Jun 23, 2016

    @wesrupert

    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.

  9. isidorn commented on Jun 24, 2016

    @isidorn

    Wes Rupert (@wesrupert) true, can you please create a seperate issue for that. Thank you.

  10. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

debugfeature-request

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions