-
Notifications
You must be signed in to change notification settings - Fork 133
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
Allow to use Variable's evaluateName in setVariable request #188
Comments
This request makes a lot of sense. But allowing to use an So I suggest to add an optional property /**
* Optional evaluatable name of this variable which can be used in an
* 'evaluate' request to set the variable's value.
*/
evaluateName?: string; I don't think that we need any new capabilities for this. @connor4312 @isidorn what do you think? |
I agree this request makes perfect sense and in order to not break anybody a new optional field should be added. |
Maybe I am missing something, but couldn't a client already do this if the DA supports |
@gregg-miskelly many thanks for reminding us about the Yes, Both requests are controlled by capabilities: To provide better guidance when to use If a debug adapter supports both @gregg-miskelly @connor4312 @isidorn what do you think? |
I was also not aware of the |
Huh, interesting. I'm curious about the difference between them. Should the protocol be refined in some way to avoid this? |
Go debug adapter also allows expressions as If vscode supports |
Thanks for the feedback. I suggest that we keep the I've created #195 for the So I'm asking again: |
The clarification sounds good to me. |
Both the |
@weinand Once we settle on this proposal feel free to create an issue for me on the VS Code side so I update how VS Code client behaves. |
@gregg-miskelly I've changed the wording of my proposal to make it more clear that it only makes sense for clients to use Modified proposal:
With this your debug adapter could still control the client's use of |
@isidorn I've created microsoft/vscode#124679 for tracking the adoption in VS Code. |
No, because |
@gregg-miskelly since your DA implements both |
|
VS Code doesn't use |
Sorry, top level items in the watch window. |
Variable
in DAP hasevaluateName
which is used when evaluateRequest is made. This is particularly useful when accessing nested fields in a complex data structure.For example, Go debug adapter represents
t
's fieldI
as a Variable like the followingThat allows us compact and comprehensible display of the struct variable while still allowing us to get the correct syntax to locate the nested field.
I noticed however, setVariable request uses
name
ofVariable
, notevaluateName
.https://github.com/microsoft/vscode/blob/5207b984029a2fa8eb4133f594218d25f5325e29/src/vs/workbench/contrib/debug/common/debugModel.ts#L248
We can make the debug adapter to recompute the
evaluateName
by looking up data with "variablesReference" and "name" info. But, it's sad that the debug adapter has already provided the fully qualified name to vscode but has to recompute it.I'd argue using
evaluateName
here is reasonable given that - it tells us how to access the variable for read, and so it should be good for write too.If it's too late to change setVariable request's
name
to beevaluateName
, is it possible to add an optionalevaluateName
to the setVariable request?--
Originally filed as microsoft/vscode#120774
to see if this requires a spec change or changing vscode's debug code to reuse existing
name
for different purpose is sufficient.The text was updated successfully, but these errors were encountered: