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

Aperta
#64,937 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@MadalinWolf ci sta già lavorando.

Dal 24/10/2026.

  • #64949 di @MadalinWolf — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
70/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
tooling

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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)

Lingua principale
Go
Stelle
112k
Fork
15.4k
Merge medio
3g 1h
PR unite (30g)
136

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/TypeScript

Tutte le issue di microsoft/TypeScript

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.