mylesmmurphy / prettify-ts

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

Unexpected unwrapping of tuple type #37

Open jasonkuhrt opened 2 months ago

jasonkuhrt commented 2 months ago

Thanks for your work on this, exciting to be trying it out. I don't think this is expected, right? It's hardly usable so assuming this is bug/oversight.

CleanShot 2024-09-19 at 20 34 42@2x

CleanShot 2024-09-19 at 20 34 48@2x

mylesmmurphy commented 2 months ago

Hey @jasonkuhrt! Thanks for bringing this to my attention. Tuples are absolutely a missed case, but also should hopefully be an easy fix. I will make sure this gets included in the next release, thanks 😄

Just to be sure, would you expect the preview to be the following?

const abcEnum: {
    0: "enum";
    1: true;
}

Is that correct?

jasonkuhrt commented 2 months ago

Awesome. I would prefer [x,x] format but not sure what the constraints are here.

mylesmmurphy commented 2 weeks ago

Hey @jasonkuhrt thanks for your patience! I've got this added in #53 and hope to have this released as part of v0.1.6 asap. I landed on your syntax 😄

image image
jasonkuhrt commented 2 weeks ago

Awesome!