Skip to content

Fundamental Intellisense Hover Display Requirements: Type Name and Signature #59830

Not planned
@JordanHoffman

Description

@JordanHoffman

πŸ” Search Terms

IntelliSense

βœ… Viability Checklist

  • 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 isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
    This 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:

  1. The name of the type
  2. 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

  1. What do you want to use this for?
  • Hovering over types to see BOTH their name and signature
  1. What shortcomings exist with current approaches?
  • doesn't exist in current state
  1. 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

MartinJohns commented on Sep 2, 2024

@MartinJohns
Contributor

Related: #59029

Oblarg

Oblarg commented on Sep 2, 2024

@Oblarg

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

JordanHoffman commented on Sep 2, 2024

@JordanHoffman
Author

Related: #59029

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

RyanCavanaugh commented on Sep 3, 2024

@RyanCavanaugh
Member

Is this level of sarcasm / condescension truly necessary? Good grief.

JordanHoffman

JordanHoffman commented on Sep 3, 2024

@JordanHoffman
Author

Is this level of sarcasm / condescension truly necessary? Good grief.

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @JordanHoffman@MartinJohns@RyanCavanaugh@Oblarg

        Issue actions

          Fundamental Intellisense Hover Display Requirements: Type Name and Signature Β· Issue #59830 Β· microsoft/TypeScript