Open kieselai opened 1 month ago
Hi @kieselai Sorry for the delay again! This one is tricky... As far as I know, the TS Language Server doesn't provide a way to know what properties on a type are inherited from an object's prototype, but I could be wrong. I will look into this and get back to you. The TS LS does provide flags and checks for if a type is a built in primitive, which is how the current check prevents displaying all these ugly types prototype props. I will look into this and get back to you!
Alternatively, if there is some way to check the type in the left hand side of an "extends" clause, maybe the expansion could be prevented based on a hard coded list of standard built-in types? The types listed out in Mozilla's docs could be useful for such an implementation.
All of the values in these types are expanded to include the full prototype of the built in primitive or object, specifically when used in an extends clause of a generic type parameter.