-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Handle multiple scopes in the debugger variables viewer #9346
Conversation
Thanks for making a pull request to JupyterLab! To try out this branch on binder, follow this link: |
a3adb6c
to
da67c1c
Compare
d6f5fda
to
41cb162
Compare
41cb162
to
b18075e
Compare
This should be ready for a first pass of review. And can be tested on Binder (pre-built for 27b2246): https://mybinder.org/v2/gh/jtpio/jupyterlab/27b2246b021be3d3b2266b71f6e5d566629f62ef?urlpath=lab-dev |
@jtpio - is this ready for 3.0? It does look like an important fix. You asked for a first pass of review. Do you consider this PR fairly done, or do you see a lot of iteration and further work based on review comments? |
Yes, and the Binder should be pre-built to make it easier to try out: https://mybinder.org/v2/gh/jtpio/jupyterlab/debugger-scopes?urlpath=lab-dev I think this solves the main issue of handling multiple scopes. Then more iteration could be done in follow-up PRs if we think the UX should be different or tweaked. |
@afshin this looks like the compatibility issue mentioned in #9414 (comment). Which version of |
These are the things I installed right before making that screencap. Update: I am using Python 3.7.4 |
Would you be able to try with Python 3.8 in a new environment? This breakpoint issue is probably unrelated to this PR, but might still need to be fixed in the debugger extension. |
I am having trouble with this. In a brand new conda env with Python 3.8 I get the same error. And I cannot get the Binder link to load either. |
Figures, literally as soon as I sent that message, the Binder finally worked! |
@JohanMabille I finally got it working on my system when I installed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @jtpio!
In a follow-on PR, the CSS which handles truncating long paths (and making sure the title "Sources" is not obscured) can probably use some tweaking. |
Sorry for the long delay! |
@afshin On which platform did you experience the issue? (I bet on OSX, but just to be sure) |
I think that's the case based on this output ^ |
Yes I was on macOS (Big Sur, 11.0.1) |
References
Up until now the debugger would only display one scope at a time.
However after the switch to
debugpy
the variables explorer was displaying the same information twice without mentioning the name of the scopes:This PR fixes the assumptions that variables come from the first scope:
jupyterlab/packages/debugger/src/service.ts
Line 640 in 781c615
Which might have been the case until now with
ptvsd
but does not apply anymore withdebugpy
.Code changes
evaluateName
andtype
from the DAP response: https://microsoft.github.io/debug-adapter-protocol/specification#Types_VariableUser-facing changes
Before
Using the latest
xeus-python
withdebugpy
:After
Since both
xeus-python
and VS code usedebugpy
, the variables viewer now shows "special variables" and "function variables" too:EDIT: updated the screencast to show the latest status:
Backwards-incompatible changes
This is mostly a UI change and should still be compatible with the previous versions of xeus-python that rely on
ptvsd
.