Description
π Search Terms
IntelliSense
β Viability Checklist
- This wouldn't be a breaking change in existing TypeScript/JavaScript codeThis wouldn't change the runtime behavior of existing JavaScript codeThis could be implemented without emitting different JS based on the types of the expressionsThis isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-TypesThis feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
β Suggestion
When I hover over a type, IntelliSense should have the bare minimum ability to display 2 things:
- The name of the type
- Some sort of signature of the type (I understand if it gets unfeasible for complex/large types, but at least display the starting properties or something!)
How helpful is it to me to hover over a variable and all I see is the name of the type? Sure, a little helpful, but do I know what values are in the type? No. So I have to keep navigating back and forth to the type to see what's in it and back to my code to do whatever I need to do.
It boggles my mind that we have such an intricately fleshed out system for typing, and yet one of the most fundamental purposes of it is barely implemented.
π Motivating Example
Before:
I hover over my variable and all I see is this: "MySuperSpecialType"
After:
I hover over my variable and I see: "MySuperSpecialType", followed by the list of its properties and their types. 10x more helpful.
π» Use Cases
- What do you want to use this for?
- Hovering over types to see BOTH their name and signature
- What shortcomings exist with current approaches?
- doesn't exist in current state
- What workarounds are you using in the meantime?
- Sometimes I make a super weird type to be the return value of another type just so I can see what its values are when I hover, but then I lose the type name when I hover.
Activity
MartinJohns commentedon Sep 2, 2024
Related: #59029
Oblarg commentedon Sep 2, 2024
Note that
interface
declarations will never expand, because they're nominal. To get a type to expand, it needs to be declared as a type.I've found the default expansion behavior taking this into account is pretty decent, and does most of what you ask here. More-detailed control would be nice but I don't see how it'd be ergonomic/sensible without guiding annotations to tel TSC how to expand the types. TypeDoc faces the same issue.
JordanHoffman commentedon Sep 2, 2024
Looks like for now I'll use this extension, which was in one of the stack overflow responses in the related thread. Seems to accomplish exactly what I need.
https://marketplace.visualstudio.com/items?itemName=mxsdev.typescript-explorer&ssr=false#overview
Hopefully at some point you guys can figure out some way to accomplish this. Can't be rocket science.
RyanCavanaugh commentedon Sep 3, 2024
Is this level of sarcasm / condescension truly necessary? Good grief.
JordanHoffman commentedon Sep 3, 2024
Im sorry. After looking at this, me being frustrated is no excuse to be rude. Im adding "being more respectful" to my feature request list for self-improvement (for real, no sarcasm intended).