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
To be able to use the debug protocol in other IDEs (Visual Studio, Xamarin Studio) or VS Code in the future we should think about how the debug protocol should support editing variables. Something like:
Note that I would expect this to be able to fail with a message (ex: the new value has a syntax error), but I think a normal error response could be used there.
Seems like we might also want some sort of 'isEditable' attribute on evaluate results to let the IDE know if editing should be allowed.
Gregg Miskelly (@gregg-miskelly) sure, I will add more details to the description after I've used this in node-debug. I just wanted to get this into VS Code so that we can build the UI and explore the details.
Gregg Miskelly (@gregg-miskelly) our current development model is to only add things to the debug protocol that we've used ourselves. Only exception so far is the module view. So we are excited to get a PR for that. :-)
Got it. How do you want to handle then features which aren't in VS Code? For example, I imagine it will be a while before you get to #34, but you might want it some day, where as we will need it soon for Xamarin studio. Do we just want to agree on something in these issues?
Andre Weinand (@weinand) that is great to hear! However, it still seems like at least one of the issues I opened is something that it will be a while before it makes sense to add to VS Code, right? If so, how would you like to handle this? We would like make sure that we add to the protocol in a way that your team is happy with.
Gregg Miskelly (@gregg-miskelly) right, if we are happy with a feature request, then we have no problems adding it to the protocol. Currently we are going through your issues and we will raise all concerns and discuss them with all stakeholders one by one.
Seeing implementations, adoptions, and PRs on all fronts is an excellent way to validate (protocol) designs and to foster progress.
PowerShell has some variables that are constant/readonly. I assume we can set the response.success to false and if we provide a response.message, VSCode UI would display that, right?
Andre Weinand (@weinand) in our discussions on the 'type' thread, I realized that there is one other item we would probably want here --
interface Variable
{
...
// Optional string that is the initial value if the user attempt to edit this variable. If not
// provided, 'value' is used instead. This is used for the case that the debug adapter
// and/or underlying debugger have done steps to improve the display of the variable
// which makes the value invalid syntax (ex: include the type of the value in 'value')
editableValue?: string;
I second Gregg Miskelly (@gregg-miskelly)'s suggestion to add an editableValue string to Variable. Currently since Variable only contains name and value as display properties, the only way to show type information is to format it into value, e.g. i: 3 [int]. This means that when the user clicks into the field to edit it, they have to clear out the [int] part of the string every time. Being able to pass separate edit and display values would make this experience a lot cleaner.
Andre Weinand (@weinand) support for type will definitely reduce our need for this, but editableValue is a concept we have in VS for other scenarios too - sometimes its useful to have a display name which is different than the editable value. Consider a character pointer in C++ for example. The editable value might just be something like 0x123456 where the display could be '0x123456 "The string value pointed to goes here"'. I couldn't tell you off hand all the scenarios where we have an editable value which is different from the display value, but I do know that we have them even for C#.
Gregg Miskelly (@gregg-miskelly) I see the need, but not for this sprint. Please adopt what will be available in June and we can iterate over the issues after that.
Andre Weinand (@weinand) I have a question about the protocol. The SetVariableArguments type defines name to be of type number. But when I look at in the debugger, it is coming across as a string. String makes sense to me but how can this work if the .ts is typed as a number. The magic of JavaScript? ConfusedInColorado. :-)
Activity
daviwil commentedon Jun 7, 2016
I know Keith Hill (@rkeithhill) would definitely be interested in this for the PowerShell extension.
add protocol support for setting variables; first cut of #27
add protocol support for setting variables; second cut of #27
weinand commentedon Jun 15, 2016
I've added a first cut of a 'SetVariableRequest' to the debug protocol:
333b123 and 38a49b2
gregg-miskelly commentedon Jun 15, 2016
Looks good to me. One suggestion: in the description for the request do you think we should try and call out that support for the command is optional?
weinand commentedon Jun 15, 2016
Gregg Miskelly (@gregg-miskelly) sure, I will add more details to the description after I've used this in node-debug. I just wanted to get this into VS Code so that we can build the UI and explore the details.
gregg-miskelly commentedon Jun 15, 2016
Cool. I didn't realize you guys were planning to support it in the UI. Sounds great.
weinand commentedon Jun 15, 2016
Gregg Miskelly (@gregg-miskelly) our current development model is to only add things to the debug protocol that we've used ourselves. Only exception so far is the module view. So we are excited to get a PR for that. :-)
gregg-miskelly commentedon Jun 15, 2016
Got it. How do you want to handle then features which aren't in VS Code? For example, I imagine it will be a while before you get to #34, but you might want it some day, where as we will need it soon for Xamarin studio. Do we just want to agree on something in these issues?
weinand commentedon Jun 15, 2016
Gregg Miskelly (@gregg-miskelly) with #34 we are closer than you think... yes, we will agree on something (but in both directions).
gregg-miskelly commentedon Jun 15, 2016
Andre Weinand (@weinand) that is great to hear! However, it still seems like at least one of the issues I opened is something that it will be a while before it makes sense to add to VS Code, right? If so, how would you like to handle this? We would like make sure that we add to the protocol in a way that your team is happy with.
weinand commentedon Jun 15, 2016
Gregg Miskelly (@gregg-miskelly) right, if we are happy with a feature request, then we have no problems adding it to the protocol. Currently we are going through your issues and we will raise all concerns and discuss them with all stakeholders one by one.
Seeing implementations, adoptions, and PRs on all fronts is an excellent way to validate (protocol) designs and to foster progress.
rkeithhill commentedon Jun 15, 2016
PowerShell has some variables that are constant/readonly. I assume we can set the
response.successtofalseand if we provide aresponse.message, VSCode UI would display that, right?weinand commentedon Jun 15, 2016
Keith Hill (@rkeithhill) yes, exactly that would be the way to deal with read only variables.
gregg-miskelly commentedon Jun 15, 2016
Andre Weinand (@weinand) in our discussions on the 'type' thread, I realized that there is one other item we would probably want here --
weinand commentedon Jun 21, 2016
Gregg Miskelly (@gregg-miskelly) David Wilson (@daviwil) Keith Hill (@rkeithhill) Jackson Davis (@jacdavis) Felix Becker (@felixfbecker) Luke Hoban (@lukehoban) roblourens Don Jayamanne (@DonJayamanne) Jan Jurzitza (@WebFreak001) Peng Lyu (@rebornix)
A first version of 'variable editing' support is now available in the Insider build (node-debug) and the 'next' version of the debug protocol.
Still missing is the UI for showing errors.
weinand commentedon Jun 23, 2016
We've added the UI for showing errors returned from the
setVariablesRequestwesrupert commentedon Jun 23, 2016
I second Gregg Miskelly (@gregg-miskelly)'s suggestion to add an editableValue string to Variable. Currently since Variable only contains
nameandvalueas display properties, the only way to show type information is to format it intovalue, e.g.i: 3 [int]. This means that when the user clicks into the field to edit it, they have to clear out the[int]part of the string every time. Being able to pass separate edit and display values would make this experience a lot cleaner.weinand commentedon Jun 23, 2016
Wes Rupert (@wesrupert) please consider to make use of the
typeattribute which will become available in the June release. See #32wesrupert commentedon Jun 23, 2016
Andre Weinand (@weinand) Great! I'll work on updating the plugin based on the new protocol changes.
gregg-miskelly commentedon Jun 23, 2016
Andre Weinand (@weinand) support for
typewill definitely reduce our need for this, but editableValue is a concept we have in VS for other scenarios too - sometimes its useful to have a display name which is different than the editable value. Consider a character pointer in C++ for example. The editable value might just be something like 0x123456 where the display could be '0x123456 "The string value pointed to goes here"'. I couldn't tell you off hand all the scenarios where we have an editable value which is different from the display value, but I do know that we have them even for C#.weinand commentedon Jun 23, 2016
Gregg Miskelly (@gregg-miskelly) I see the need, but not for this sprint. Please adopt what will be available in June and we can iterate over the issues after that.
gregg-miskelly commentedon Jun 24, 2016
Andre Weinand (@weinand) will do. Would you like us to open an issue for adding this for the future?
rkeithhill commentedon Aug 20, 2016
Andre Weinand (@weinand) I have a question about the protocol. The SetVariableArguments type defines
nameto be of typenumber. But when I look at in the debugger, it is coming across as a string. String makes sense to me but how can this work if the .ts is typed as anumber. The magic of JavaScript? ConfusedInColorado. :-)weinand commentedon Aug 20, 2016
Keith Hill (@rkeithhill) your 'protocol' link from above refers to an erroneous commit.
This problem no longer exists in the 1.11.0 version of the protocol.
Here is the link to the 'master' branch:
https://github.com/Microsoft/vscode-debugadapter-node/blob/master/protocol/src/debugProtocol.ts
rkeithhill commentedon Aug 20, 2016
My sanity has been restored. Thanks!