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

[Request] Disable expansion of generic objects #39

Open
dakaza98 opened this issue Oct 2, 2024 · 2 comments
Open

[Request] Disable expansion of generic objects #39

dakaza98 opened this issue Oct 2, 2024 · 2 comments

Comments

@dakaza98
Copy link

dakaza98 commented Oct 2, 2024

Hi!
First I just want to say great job with this plugin, it is really handy! Keep up the good work!

My issue

I work a lot with Angular and therefore a lot with Observables from rxjs. When I hover on my observable type, the list gets very long since observable is a quite large object so I have to scroll quite far down.

image

This is the definition of UnmappedPdfs
image

I tried using the Skipped type names setting by adding Observable to the list but this did not have any effect and when I hovered again, the whole observable type still got expended.
image

I did notice however that when i changed the setting to the exact type it worked
image

image

However, this also disables the expanding of my own type UnmappedPdfs.

What I would like to achieve

It would be nice if I could in some way not have the observable be expended when I hover it. So instead of seeing all the observables properties I would instead see

Observable<{ pdfs: string[], verified: boolean }>

How to solve this

I'm not sure how to solve this and you know the plugin better than me. Would perhaps allowing generic types in the skip type name be an option? I also saw issue #32, perhaps that could be a solution to the issue?

Let me know what you think and if you think that this would be a valuable feature or if it is beyond the scope of this plugin!
Cheers!

@mylesmmurphy
Copy link
Owner

mylesmmurphy commented Oct 5, 2024

Hey @dakaza98!
Thanks for mentioning this.

Generics are absolutely a sore spot for this extension right now, the hardest part has been knowing when to show the "apparent" type (resolved generic), or when to do what you showed above.

Right now there is custom logic for Promises to unwrap the type argument but not the Promise type itself. I could turn that into another setting where items can be added. So if you added "Observable" to that list, it could display as you mentioned!

As a side note, I use Angular at work and have ran into how awful observables look with my extension as well, so definitely want to get this cleaned up! 😄

Edit: If you have a good idea for the setting name, and what the default values should be (including "Promise"), I'd love some input. "Unwrap Arguments Type Names"?

@dakaza98
Copy link
Author

dakaza98 commented Oct 6, 2024

Wonderful!
Skip Generic Type Names, perhaps? Unwrap Arguments Type Names could also work.

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

No branches or pull requests

2 participants