-
-
Notifications
You must be signed in to change notification settings - Fork 203
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
Control the output verbosity or how expressions are printed in DAP REPL #737
Comments
A new option `show_tree` can be set by users to configure whether to show the expandable tree in the DAP REPL window. Concise and simple representation in the REPL would be useful for many languages, see mfussenegger#737 for an example (python). The option can be configured using, for instance: ``` require('dap.repl').show_tree = false ```
Relates to #1062 This seems a bit specific to python. Only printing the root would make it significantly worse for other languages. Always printing Other than that I think it would require some custom formatting hooks. I'm open to suggestions how those could look like |
Is it difficult to make the tree collapsible by default or upon configuration? Or any kind of configuration point will be great. |
I agree with this completely! Here are a few examples of how other debugger environments handle this:
While I generally think that language-specific hooks are yucky, I think the alternative of printing the entire tree is worse in terms of user-experience and it's not what has come to be expected from a Python debugging experience. In summary, I think the best options would be, in order:
One could also make the argument that you could just print objects each time you want to see the |
Problem Statement
Can we control how an evaluated expression is printed in the DAP REPL? If the default one is too verbose, showing all the attributes (as a tree) expanded, can we make it compact so that it behaves closer to conventional debuggers --- specifically, when it comes to python, like pudb or ipdb.
(This might be a bit python-specific, but could be related to other languages as well.)
For instance, when printing out some python object in the REPL, it shows not only the
__repr__
representation but also all the attributes as in the variables/watches widget. As an example, apandas.DataFrame
object will print ~100 attributes and lines that would be too much verbose and not that quite informative.Possible Solutions
(1) Always print the attribute tree in the REPL window, but make it collapsible so that when collapsed it takes at most one line. In this particular example, it may show a few, concise lines like (which could be collapsible and expandable):
(2) Add an option (in any ways) to completely disable displaying the attributes; and print the
__repr__(object)
only as ipdb, pudb, etc. does.Considered Alternatives
microsoft/debugpy#1078
The text was updated successfully, but these errors were encountered: