TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

jsdoc property description does not work on index signatures

Open ab-pm opened this issue 3 years ago • 0 comments

🔎 Search Terms

index signature description documentation comment annotation jsdoc

💻 Code

interface Example {
    /** Something generic */
    [p: string]: any;
    /** Something specific */
    property: number;
}

function example(e: Example) {
    console.log(e.property); // works, shows type and description on hover
    console.log(e.anything); // shows type of property but not description on hover
}

Playground with relevant code

🙁 Actual behavior

e.anything only gets the type (any) declared for the property

🙂 Expected behavior

When hovering over the property e.anything, the description "Something generic" should show up in the tooltip

(this is a folloup to #47256)

ab-pm avatar Feb 17 '22 14:02 ab-pm