Skip to content

Inconsistent quick info on optional properties when supporting hover verbosity #61954

Open
@DanielRosenwasser

Description

@DanielRosenwasser
interface BorderOptions {
    color?: string;
    radius?: string;
}

interface ColorOptions {
    background?: string;
    foreground?: string;
}

export interface Options {
    width?: number;
    height?: number;
    color?: ColorOptions;
    border?: BorderOptions;
}


export function drawButton(options: Options) {

    // ...

    options;

}

In the latest TypeScript, if you expand out the quick info on the parameter options (not the type - this is subtle) with more verbosity, you'll get

(parameter) options: {
    width?: number | undefined;
    height?: number | undefined;
    color?: ColorOptions | undefined;
    border?: BorderOptions;
}

Image

Notice that color and border are inconsistent with what they display.

Similarly, if you switch Options to be a type alias instead of an interface, you'll see the same inconsistency.

Image

That's not the behavior of the playground, where hover verbosity isn't supported.

Image

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: Type DisplayBugs relating to showing types in Quick Info/Tooltips, Signature Help, or Completion Info

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions