mylesmmurphy / prettify-ts

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

TSDoc needs to be visible on hover. #28

Open salmin89 opened 2 months ago

salmin89 commented 2 months ago

The TSDoc that I've added to my class is all the way at the bottom. Look how much I would have to scroll to see it. I think the TS/JS-Doc needs to be brought further up.

image
mylesmmurphy commented 2 months ago
  1. Hey @salmin89!

I can absolutely add JSDoc to the preview. Would you expect to see the JSDoc for both the original type, and all of the object property types to show up? I'm thinking two possible options:

  1. A single setting to show / hide ALL JSDoc (root type and sub-properties)
  2. Two settings, one for root type and another to show / hide sub-properties as well?

Would you also mind sharing which version of Prettify TS you're on?

salmin89 commented 2 months ago

Hey @mylesmmurphy, sorry for the late reply!

My ext version is v0.1.5

In regards to your question - It would be need if it also expands all the property JSDocs (but not if it impacts performance to much?). Having it configurable would def. be interesting. (personally I'd prefer option #2 because it allows more flexibility).

But if I ever encounter a type that has 10 paragraphs per property - I would probably get annoyed about not being able to see anything on hover. How about also the option to truncate (set max length) on properties only in these cases?