Skip to content

Signature help shows no JSDoc for a const with a function type annotationΒ #64937

Open

Description

πŸ”Ž Search Terms

signature, parameter hints, jsdoc, const, type annotation, function type, @param

πŸ•— Version & Regression Information

  • This changed between versions 6.0.3 and 7.0.2 (also in 7.1.0-dev.20261023.1)

⏯ Playground Link

https://www.typescriptlang.org/play/?#code/PQKhCgAIUhBATeBnSB7AdgU0gF1ZAQ0nQFcBbAI0wCcA6KGAAQAcDqCzIA3AgGxOwAVABbZSlGrnwFEaLFPrRg4eJgDGvNtjUYkOQogDyWAFyQAFD36Yz4qtQCUkALwA+YuXsBucOBnxjTCA

πŸ’» Code

/**
 * Adds one to a number.
 * @param value The number to add one to.
 */
declare const addOne: (value: number) => number;

addOne(1);
//     ^ trigger signature help here

πŸ™ Actual behavior

Signature help shows addOne(value: number): number with no description and no documentation for value. Hover on addOne does show the JSDoc.

(Type ( in the playground to ensure JSDoc is shown for the parameter in TS 6)

πŸ™‚ Expected behavior

Signature help shows "Adds one to a number." and "The number to add one to." for value, like 6.0.3 does.

Additional information about the issue

The same happens with an initializer, like const addOne: (value: number) => number = otherFunction.

(const addOne = (value: number) => value + 1 works: the docs come from the arrow function)

Activity

  1. MadalinWolf commented on Oct 24, 2026

    @MadalinWolf

    I've opened a PR to address this: [Fix signature help docs for const function types](https://github.com/MadalinWolf/TypeScript/pull/64949).

    The change adds a fallback to retrieve JSDoc from the const declaration when it's missing from the candidate signature's declaration. I've also added a regression test, and the focused test passes.

    Thanks for reporting this!

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions