Improve Generic Class + Namespace Intellisense #60943
Labels
Experience Enhancement
Noncontroversial enhancements
Help Wanted
You can do this
Suggestion
An idea for TypeScript
Milestone
π Search Terms
generic class, namespace, intellisense, hover hint
β Viability Checklist
β Suggestion
The hoverhint on namespaces declaration merged with generic classes gets ugly. I would prefer if they were simpler. Here's an example:
Because namespaces cannot access the generics of the class I also think it's a bit misleading of a display and arguably a bug. If it is intentional I would love to know. However I opened this issue as a feature request partially because I would like it to change even if this behavior is intentional.
This same phenomenon does not happen with associated functions only with classes. Perhaps this is because namespaces can be automatically generated on functions:
Compiles to this
.d.ts
file:However I cannot find a way to get a poor intellisense even when I manually add
type
s,const
s etc. so it appears to be a phenomenon exclusive to classes.π Motivating Example
π» Use Cases
When I have a complex class with a great number of associated methods and interfaces the most natural way of organizing seems to be namespaces for this project. It's a bit older and heavily uses globals but that won't be changing any time soon and so this is the most convenient way of being organized.
Unfortunately whenever classes are generic the hover hints become unwieldy and I'd prefer for them not to be.
The text was updated successfully, but these errors were encountered: