mylesmmurphy / prettify-ts

Prettify TypeScript: Better Type Previews
https://marketplace.visualstudio.com/items?itemName=MylesMurphy.prettify-ts
MIT License
181 stars 6 forks source link

Hovering on a first-level type definition shows the type twice #4

Closed busybox11 closed 5 months ago

busybox11 commented 6 months ago

As the title says, whenever I hover a "first-level" type (a type without any extension or anything - just the type itself), I have its definition shown twice in VSCode's popup, one from the already existing TS features, one from this extension.

image

Could it be possible to hide either one of them when this happens? The initial TS features can show useful type info outside of this case, so I don't think it's a good idea to remove them altogether.

What do you think about it?

(Also, the tab padding isn't the same as the rest of the already existing TS features uses. For the sake of consistency, could it be a good idea to standardize it? This is only a suggestion though)

busybox11 commented 6 months ago

Weird, it also seem to have conflicting type results.. Haven't had the time to look into it. Figured it would be worth to mention it here, just in case.

image

mylesmmurphy commented 6 months ago

Hey @busybox11! Thanks for bringing this to my attention. I am currently in the process of exploring options for optimizing the extension, in which I can probably include checks to make sure we're not displaying information that isn't helpful.

I will look into the incorrect typing as well on the array. Are you able to send a code snippet I can debug off of by any chance? Thanks again :)

mylesmmurphy commented 6 months ago

Hi @busybox11 Wanted to update you, I've got some working changes which implement your feedback, with a PR here: https://github.com/mylesmmurphy/prettify-ts/pull/5

Going to be thoroughly testing these changes now, but should hopefully be merged and released in the next couple of days!

mylesmmurphy commented 5 months ago

Just released v0.0.14, which covers all of the feedback here. Thanks again for your thoughts! Please try out the latest version, and please don't hesitate to send more feedback if you have any!

busybox11 commented 5 months ago

Hi! Apologies for the late response. Had a pretty busy week. I continued to use the extension the last couple of days and it has been working great!

I'm really glad to see your updates, I'm going to check this out soon and I'll get you updated on that. Same goes for the code snippet. I'll try to reproduce it, though unfortunately those were stale changes that have been modified since, and unfortunately I didn't save that state of the code.

Thanks again! Also happy new year :)

mylesmmurphy commented 5 months ago

No problems at all! Really happy to hear the extension is working as expected.

In an older version, users reported seeing the "any" type show up because I hadn't set up the extension to use the user's tsconfig. A PR was created to fix this issue by finding and using the a tsconfig file, but it wasn't set up to work with a monorepo.

The most recent version of the extension now will work correctly with monorepos or non-standard locations for tsconfigs, so I'm hoping that resolves your issue. 🤞 Please let me know if you're still able to reproduce or seeing any other issues and I'd be happy to work on a fix!

Happy new year to you as well 🥳