-
Notifications
You must be signed in to change notification settings - Fork 145
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
Return scope metadata on ScopesRequest #1085
Comments
@fabioz How tough is it implementing this? As far as I'm aware, internally |
Well, the scope request only gives It shouldn't be hard to provide the local variables scope source/lines (there are utilities for getting the frame and then getting the code and querying for lines/source should be reasonably straightforward, although some care needs to be done to translate paths to the client according to path mappings). Something as:
The debugger doesn't create a separate scope for arguments (so, if you're thinking about the scope for the arguments that'd be harder as that scope would need to be created first, but for locals it should be straightforward). @gfszr Are you interested in providing a PR? Note that as this is all in |
@fabioz Thanks for the quick reply! 😄 For the following days I don't have a lot of time to take care of it, but I have traversed the code a was bit and was curious as to how hard it can be to implement it. I'm also interested to see what turns out of microsoft/debug-adapter-protocol#343 which is even more specific, and if it's even easier to implement rather than scopes, then it'd provide an even more accurate result. |
Regarding that other request, I'm not sure... it seems clients usually can usually know about that and should be able to make that mapping without additional debugger support. I believe that's even possible already. See: https://stackoverflow.com/questions/62337163/visual-studio-code-how-to-display-variable-values-inline-during-debugging |
They use the client knowledge to get info on the scope (and then just query the debugger to get the value). |
@fabioz Thanks! |
Scopes returned by the
ScopesRequest
are returned withoutsource
andstartLine
, which are optional values according toScope
's schema:Currently,
debugpy
doesn't fill any of these values, which are in practice extremely useful when the UI wants to present scope variables (Such as locals) in a pretty way over the definition and source code.The text was updated successfully, but these errors were encountered: