Signature help shows no JSDoc for a `const` with a function type annotation

Aberta
#64,937 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

@MadalinWolf já está trabalhando nisso.

Desde 24/10/2026.

  • #64949 de @MadalinWolf — aberto

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
70/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
typescript
Domínio
tooling

Direção de pesquisa

Start with the TypeScript language service code that provides signature help, then trace how it gets JSDoc for a function-typed const declaration. Compare the reported behavior for the declaration without an initializer, the declaration with an initializer, and an arrow function. Reproduce the case in the linked playground and add or update a regression test; done means signature help shows both the function and parameter documentation.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Bug Domain: LS: Signature Help
🔎 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)

Linguagem predominante
Go
Estrelas
112k
Forks
15.4k
Merge médio
3d 1h
PRs com merge (30d)
136

Preparar o ambiente

Abrir no Codespaces

Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de microsoft/TypeScript

Todas as issues de microsoft/TypeScript

Issues semelhantes

Mais issues de Go

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.