Closed
Description
- Declare an interface
- Consume that interface somewhere
- Hover over where you consume it
=> Intellisense won't show any internals of that interface
Do 1, 2 and 3 with a type declaration and Intellisense shows all internals. Discussion on reddit: https://www.reddit.com/r/typescript/comments/cisi08/getting_intellisense_to_show_function_signatures/evejcy0/?context=3
Expected behavior:
Show all internals of any declaration on hover.
Actual behavior:
Just shows internals of type declarations.
Playground Link:
https://codesandbox.io/s/small-bird-l13fg?fontsize=14
Hover with your mouse over IDuck
and RealDuck
in the respective const
statement.
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
jcalz commentedon Jul 30, 2019
Related to #25784? Right now there is no way to selectively expand/collapse parts of a type definition. If we could do this, then it would make sense to do this for interfaces as well as type aliases (with perhaps interfaces collapsed by default and type aliases expanded by default).
Also, an actual playground link
RyanCavanaugh commentedon Jul 30, 2019
This is one of the differences between aliases and interfaces. Interactive expansion would definitely be nice; see the above linked issue
po35 commentedon Jul 31, 2019
Thanks for the fast feedback and the playground link!
Yes, but #25784 is more specific since it addresses collapsing. I just want to get the same info from an interface I get from type on hover.
I am still on the fence re TS. Yes it helps and there is a lot of good stuff but there are also some subpar things. If I already make the work, declare type/interfaces for all my code I want to be able to see their definition anywhere easily. Having to go to the definition of interfaces to get the interface is not that much better than just going to a plain JS object and checking briefly its signature or its JSDoc. And there's actually no reason to treat interface differently than type. Btw, a JSDoc would have been showed on hover.
So, I'd be happy to see a PR here. Thanks!
ps. and which spec for TS reflects that 'it's working as intended', feels rather like a bug
typescript-bot commentedon Aug 2, 2019
This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes.
brillout commentedon Oct 6, 2023
Related feature request: #56010.