Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Expandable Quick Info/Hover Verbosity #59029

Open
DanielRosenwasser opened this issue Jun 26, 2024 · 1 comment
Open

Support Expandable Quick Info/Hover Verbosity #59029

DanielRosenwasser opened this issue Jun 26, 2024 · 1 comment
Assignees
Labels
Domain: Quick Info e.g. hover text, tool-tips, and tooltips. Domain: Type Display Bugs relating to showing types in Quick Info/Tooltips, Signature Help, or Completion Info

Comments

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Jun 26, 2024

There is a lot of interest and discussion in #38040 and #56010 when it comes to showing/hiding details of a quick info request. In microsoft/vscode#195394, we have a proposed client/editor API to serve up such an experience, and we'd like to provide it.

There are some questions that still need to be answered and prototyped. For example, what precisely should be expanded? In some cases, a type reference can be expanded into its structural form. In others, an elision (...) can possibly be shown. Whether this is always desirable is questionable.

@DanielRosenwasser DanielRosenwasser added Domain: Type Display Bugs relating to showing types in Quick Info/Tooltips, Signature Help, or Completion Info Domain: Quick Info e.g. hover text, tool-tips, and tooltips. labels Jun 26, 2024
@DanielRosenwasser DanielRosenwasser added this to the TypeScript 5.6.0 milestone Jun 26, 2024
@DanielRosenwasser
Copy link
Member Author

DanielRosenwasser commented Jun 26, 2024

Moving this out of the issue body, since this is more of my own suggestion than a spec.

A good experience here may need some clever thinking. Some parts of quick info which a user may want to expand may be totally unrelated to what actually gets expanded out.

One possible direction here is to expand in a breadth-first way instead of depth-first. For example, if a user sees the following type:

/* Verbosity 0 */
{
    foo: Foo,
    bar: Bar,
    baz: Baz,
}

expanding on a depth-first basis might pop everything out in the following way

/* Verbosity 0 */
{
    foo: Foo,
    bar: Bar,
    baz: Baz,
}

/* Verbosity 1 */
{
    foo: {
        fooProp: string
    },
    bar: {
        barProp: string
    },
    baz {
        bazProp: string
    },
}

whereas allowing expansion on a breadth-first level might be a little less daunting, albeit more tedious:

/* Verbosity 0 */
{
    foo: Foo,
    bar: Bar,
    baz: Baz,
}

/* Verbosity 1 */
{
    foo: {
        fooProp: string
    },
    bar: Bar,
    baz: Baz,
}

/* Verbosity 2 */
{
    foo: {
        fooProp: string
    },
    bar: {
        barProp: string
    },
    baz: Baz,
}

/* Verbosity 3 */
{
    foo: {
        fooProp: string
    },
    bar: {
        barProp: string
    },
    baz {
        bazProp: string
    },
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: Quick Info e.g. hover text, tool-tips, and tooltips. Domain: Type Display Bugs relating to showing types in Quick Info/Tooltips, Signature Help, or Completion Info
Projects
None yet
Development

No branches or pull requests

2 participants