Skip to content
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

[Debugger] Treat user variable filter settings as a mergable add-on #9903

Open
afshin opened this issue Apr 21, 2020 · 4 comments
Open

[Debugger] Treat user variable filter settings as a mergable add-on #9903

afshin opened this issue Apr 21, 2020 · 4 comments

Comments

@afshin
Copy link
Member

afshin commented Apr 21, 2020

When the user sets variableFilters in their own user settings, these should be merged with the defaults instead of overwriting them. If this behavior is something that users object to, we can add a boolean to set whether the behavior is to merge or the overwrite in the future.

@jtpio jtpio transferred this issue from jupyterlab/debugger Mar 5, 2021
@jtpio jtpio changed the title Treat user variable filter settings as a mergable add-on [Debugger] Treat user variable filter settings as a mergable add-on Mar 5, 2021
@jtpio jtpio added this to the Future milestone Mar 5, 2021
@JohanMabille
Copy link
Member

JohanMabille commented Mar 5, 2021

I think most of the current defaults should actually be moved to the backend, because there are kernel specific.
We could add a field in the debug_info_request listing these variables so they can be merged with those set by the user.

@jtpio
Copy link
Member

jtpio commented Mar 5, 2021

It's also worth noting that debugpy now puts some of the original filtered variables (which was not the case with ptvsd):

"debugpy",
"display",
"get_ipython",
"ptvsd",
"_xpython_get_connection_filename",
"_xpython_launch",
"_pydev_stop_at_break",
"__annotations__",
"__builtins__",
"__doc__",
"__loader__",
"__name__",
"__package__",
"__spec__"

Under special variables:

image

@krassowski
Copy link
Member

Slightly off-topic, but just to spell this out, it appears that the defaults for xpython are now missing:

"_",
"quit",
"exit",
"_i",
"_ii",
"_iii",
"_i1",
"_i2",
"_i3",
"_ih",
"_oh",
"_dh",
"Out",
"In"

which was not the case for older versions of xeus-python (I believe it has to do with the rework of xeus-python to be more closely tied to IPython). I might be wrong though, I don't know a lot about the debugger.

Could these filters become regular expressions? Currently it seems that specifying "_i\d" is not possible, but it could help to hide all (IPython or not) input history. There are some confused users out there on SO.

@jtpio
Copy link
Member

jtpio commented May 7, 2021

I believe it has to do with the rework of xeus-python to be more closely tied to IPython

It's mostly related to the switch from ptvsd to debugpy, and also some other refactors in xeus-python to use IPython directly (jupyter-xeus/xeus-python#400).

Could these filters become regular expressions

For sure. For now the check is happening in:

?.filter(
variable => !(filter || new Set()).has(variable.evaluateName || '')
)

So this logic could already be updated to test against regexes instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants