Have hover tooltips show instantiated / computed types when selection is multiple characters
See original GitHub issueSuggestion
🔍 Search Terms
intellisense hover type debugging selection
✅ Viability Checklist
My suggestion meets these guidelines:
- This wouldn’t be a breaking change in existing TypeScript/JavaScript code
- This wouldn’t change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn’t a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- This feature would agree with the rest of TypeScript’s Design Goals.
⭐ Suggestion
Under the following conditions:
- An area of code is selected (>=1 characters)
- The selection is a single node in the AST, ignoring whitespace
- The user has triggered a hover within that selection
…can the language service report the computed type of the selected node, either instead of or in addition to the normal hover info?
📃 Motivating Example
I don’t know of a way to get language services to show what MyA<OtherType>
computes to in this Playground example with nested type generics.
The next best strategy is to make intermediate types and/or variables to debug though. It’s kind of a pain.
💻 Use Cases
This Tweet inspired by looking at @markerikson’s talk about complex Redux-area types being annoying to debug through 😄. https://twitter.com/JoshuaKGoldberg/status/1520079650055204866
Issue Analytics
- State:
- Created a year ago
- Reactions:10
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Tooltip with shortened characters in divs - Stack Overflow
Test to see if the characters in a div are more then ten chars long · Shorten the text to less than ten...
Read more >Hover over a cell and have a pop up that shows what was ...
I am creating a manpower schedule that is pulling information from multiple tabs within the excel file. The first tab has employee ...
Read more >Option to expand computed TypeScript types on hover #94679
The impl of actual utils I'm using are inconsequential; it's the same if we'd used Pick , Omit , or Partial . It'd...
Read more >Tooltips in the time of WCAG 2.1 | Sarah Higley
Focus and hover ... The first step is to ensure that the visual display can be controlled by either a keyboard or a...
Read more >Tooltips - Material Design
Tooltips display informative text when users hover over, focus on, ... Paired. Tooltips are always paired nearby the element with which they are...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m some person on the internet and I third this idea.
I’m Mark Erikson, and I approve and second this idea 😃