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

Support Data Type Renderers #1750

Closed
cdalvaro opened this issue Mar 15, 2018 · 10 comments
Closed

Support Data Type Renderers #1750

cdalvaro opened this issue Mar 15, 2018 · 10 comments

Comments

@cdalvaro
Copy link

Please, add support for showing complex structures with pretty printers.

e.g. DateTime objects

DateTime objects are difficult to see at first-sight by default

datetimevariabledebugger

It would be very useful if the debugger view showed something like this

datetimevariabledebugger-pretty

@hurricup
Copy link
Collaborator

Well, in Java, for example, every object has toString method, which is doing exactly the thing. But perl doesn't have such mandatory method or convention.

Is there any unified method to do this? May be some module that can represent popular modules in the cool way?

I don't really want to hardcode this for every possible object.

@cdalvaro
Copy link
Author

Well, I know the module Data::Printer, that might can be useful for this purpose, like it is shown in this article

@hurricup
Copy link
Collaborator

As far as i know this is just a pretty (and may be more flexible/configurable) Data::Dumper. Not exactly what are you talking about.

The only way I can see here is to hardcode some cases and make a convention, like "if class has a to_string method it's going to be used"

@pablrod
Copy link

pablrod commented Mar 18, 2018

Although there is no toString in Perl, many objects overload the "" operator (aka stringification). That is called when a reference to an object is evaluated in string context.

Maybe this can be used as a kind of preview. With DateTime objects this works perfectly. Indeed this is what Eclipse Perl Plugin does.

image

@hurricup hurricup added this to the 2018.2 milestone Apr 10, 2018
@hurricup hurricup removed this from the 2018.2 milestone Jul 20, 2018
@juanrad
Copy link

juanrad commented Feb 6, 2019

Are there plans to include this feature? I would find this very useful.

@hurricup
Copy link
Collaborator

hurricup commented Feb 6, 2019

@juanradiego there is still no concept for this. How do you see this? I don't like the idea to hardcode serializing for different classes.

@juanrad
Copy link

juanrad commented Feb 6, 2019

As I see it, there is no need to hardcode any specifics for this particular case, because the "" operator is the default stringification in Perl objects, as @pablrod said. I think you may consider use this operator for the default preview of objects in the inline inspetor, so you will delegate in every object implementation.

Thanks for your work by the way. The plugin works very nice.

@hurricup
Copy link
Collaborator

hurricup commented Feb 6, 2019

This won't work everywhere. After some investigation, seems we need something like this: https://www.jetbrains.com/help/idea/debugger-data-type-renderers.html

@hurricup hurricup changed the title Add pretty printers for debugger variables Support Data Type Renderers Feb 6, 2019
@cdalvaro
Copy link
Author

cdalvaro commented Feb 6, 2019

Thanks @hurricup for developing this great plugin!

@hurricup hurricup added this to the 2019.1 milestone Feb 6, 2019
@hurricup
Copy link
Collaborator

Ok, I've got something like this (for the Foo::Baz, there is a configured renderer):

image

image

hurricup added a commit to Camelcade/Devel-Camelcadedb that referenced this issue Feb 15, 2019
hurricup added a commit to Camelcade/Devel-Camelcadedb that referenced this issue Feb 15, 2019
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