0

When interfaces are shown in VSCode I am able to see the number of references of every single property of the interface.

export interface Badge {
badgeId: {
contentBadgeId: string;
userId: string;
};
sourceId: string;
title: string;
image: ImageAsset;
badgeType: BadgeType;
partnerHasBadge: boolean;
userHasBadge: boolean;
earnedAt: string;
}

But if I convert that interface into a Type, the references are not shown anymore.

export type Badge = {
badgeId: {
contentBadgeId: string;
userId: string;
};
sourceId: string;
title: string;
image: ImageAsset;
badgeType: BadgeType;
partnerHasBadge: boolean;
userHasBadge: boolean;
earnedAt: string;
};

The same problem occurs with every Type, these screenshots are just an example of something that happens to me with every single Type. Is it possible to show the property reference count in Typescript Types the same way they are shown in Interfaces in VSCode?

artberri
  • 1,327
  • 13
  • 26
  • 1
    If it's possible for you to type that text up as plaintext and include it as well, it would be helpful for (some of) the reasons outlined [here](https://meta.stackoverflow.com/a/285557/2887218). – jcalz May 22 '23 at 12:54
  • @jcalz I've edited the question to add the code as image description/alt text and I've kept the images because in this case, I can not show what I want with just plain code. The question is about the IDE code lens, in fact, the code is somehow trivial, it is just an example. – artberri May 24 '23 at 07:35

0 Answers0