Skip to content

Programming the Debug Console's rendering of user data #825

@yoni-lavi

Description

@yoni-lavi

If this feature already exists, I was unable to find it (either the feature itself, or the request for one, or any discussion of it whatsoever):

Here's a couple of examples for things I'd like the data visualizer to do:

(1) It seems to have the ability to browse items inside iterables and mappings, but it seems to work on certain types, but not others.
What I would expect is that any Python object that implements a Mapping protocol will be viewed as one, then otherwise if it's Iterable it will be viewed as one.
But as you can see, list, dict and defaultdict render their items as expected, whereas MappingProxyType, dict_keys and dict_values (or zip for that matter) don't.

image

Is there a way to program VS code's debugger to make it recognize additional types?

(2) Suppose I want it to use the human-readable __str__ instead of __repr__ for inspected values, could I do that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions