-
Notifications
You must be signed in to change notification settings - Fork 31k
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
Make VS Code use DAP's "setExpression" request #124679
Comments
This makes good sense. Let me assign to June, so we change this next milestone once we finalise the DAP clarification. |
@isidorn the proposed solution might not be ideal for @gregg-miskelly. Please see the discussion starting with microsoft/debug-adapter-protocol#188 (comment) |
Thanks for the pointer, I see that it does not work for @gregg-miskelly |
I wonder, why VS Code is not using |
@weinand we are not using For the Watch expression, we do not allow to set expression from the Watch view. Only to edit, which would re-evaluate it. So it seems like there is a missing piece that VS Code starts using |
@isidorn yes, I understand why we have But in the WATCHES view there is no scope (hence no container) and we are not using |
Hi |
Yeah good point, that feature request is what is missing for this scenario it seems. |
I started investigating into this and created this PR which proves it is possible #127162 Some open questions:
I am not aware of a debug adapter that supports the |
Great ! Thanks a lot.
|
In case this is useful to you: the C# (coreclr) and Windows C++ (cppvsdbg) debug adapters support |
@weinand I have moved my comment to that issue. If you would like to keep this discussion cleaner feel free to delete my comments. |
For the broader issue of DAs that would like to avoid needing to support
|
@gregg-miskelly your suggestion makes sense and I will update the DAP doc as needed. @isidorn we should support behavior. |
@gregg-miskelly this suggestion makes good sense, I have implemented it via f1b1e3f As suggested above:
I plan to merge this later today, so this will be in Insiders next week. I would really appreciate that you try it out and provide feedback. I have only tested it with Mock debug so far. I will also create a test plan item. |
@connor4312 is it possible for js-debug to support |
Created this test plan item #130170 |
Thanks, I'm adopting this in js-debug. One point of feedback is that I think the "watch" and "variables" view should be automatically invalidated after the set completes, to match the behavior Set Value in the "variables" view. |
Oh, I was behind on Insiders. The watch view is refreshed, but should the variables view similarly be refreshed? When evaluating an expression I think all debuggers will want this since it's probably not trivial to figure out what variables might have changed as a result of the evaluation of an arbitrary expression. |
@connor4312 the variables view should also get refreshed. If that is not the case let me know and I can investigate. We basically refresh all views, since we never know how a change affect some other variables / watch expressions. And awesome that you are adopting it, let me know how it goes. |
Nevermind, it was a caching error in my own code, works well :) |
Hm, actually this is (also) caching in V8. Even after changing the variable, getting the stackframe "object" properties still returns the old value. I don't think I can work around this very efficiently 😕 |
@connor4312 it is a long standing issue I believe, since I think we were also hitting this a couple of years ago... |
In microsoft/debug-adapter-protocol#188 we've discussed how to simplify the implementation of DAP's
setVariable
request in debug adapters. The proposal asked for passing an additional "l-value expression" tosetVariable
which can be easily used in an "evaluate"-based implementation.One finding of this discussion was that DAP has already a
setExpression
request which is basically a variant ofsetVariable
that takes a "l-value expression".Based on that finding we came to the conclusion that only the following spec clarification is needed:
A consequence of this is that VS Code will start to use
setExpression
if a variable has theevaluateName
property and the debug adapter supports thesetExpression
request.The text was updated successfully, but these errors were encountered: