microsoft / microsoft/TypeScript

"Overriding" JSDoc at re-exports mostly only results in propagation of added "@deprecated" JSDoc tag

Aperta
#53,960 3 commenti 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Needs More Info
Lingua principale
Go
Stelle
111k
Fork
14.3k
Merge medio
1g 19h
PR unite (30g)
117

Descrizione

Bug Report

🔎 Search Terms

JSDoc, @deprecated, override, re-export.

Related on Stack Overflow: How can I make VS Code recognize an overridden JSDoc for a re-export?.

🕗 Version & Regression Information

I tried this with TypeScript 5.0.4 and 4.6.4. I tried 4.6.4 because I noticed that https://github.com/microsoft/TypeScript/pull/47293 happened just a bit before the release of 4.6. I witnessed the same behaviour for both versions I tried. I have described that behaviour below.

💻 Code

exporter.js:

/**
 * JSDoc from original export.
 * A thing that is definitely not deprecated.
 */
export const thing = 123;

reexporter.js:

export {
   /**
    * JSDoc from re-export.
    * A thing that is deprecated.
    * @deprecated reasons.
    */
   thing
} from "./exporter";

importer.js:

// ✅ means   expected behaviour
// ❌ means unexpected behaviour

import {
   thing            // ✅ not crossed out.  ✅ hover info: "JSDoc from original export. A thing that is definitely not deprecated."
   as originalThing // ✅ not crossed out.  ✅ hover info: "JSDoc from original export. A thing that is definitely not deprecated."
} from "./exporter"

import {
   thing              // ✅ crossed out.  ✅ hover info: "JSDoc from re-export. A thing that is deprecated. @deprecated — reasons." off. even this comment is crossed out.
   as reexportedThing // ✅ crossed out.  ❌ hover info: "JSDoc from original export. A thing that is definitely not deprecated."
} from "./reexporter";
reexportedThing();    // ✅ crossed out.  ❌ hover info: "JSDoc from original export. A thing that is definitely not deprecated."

import {
   thing // ✅ crossed out.  ❌ hover info: "JSDoc from original export. A thing that is definitely not deprecated."
} from "./reexporter"
thing(); // ✅ crossed out.  ❌ hover info: "JSDoc from original export. A thing that is definitely not deprecated."
🙁 Actual behavior

see the above code.

🙂 Expected behavior

see the above code. Everywhere with a "❌", I expected to see the overridden JSDoc in the VS Code hover info backed by tsserver.

Guida per i contributori

Apri la guida per i contributori

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.

Direzione di ricerca

Inizia con la riproduzione usando exporter.js, reexporter.js e importer.js e testala con TypeScript 5.0.4 o la nightly build tramite VS Code e tsserver. Traccia come viene propagato JSDoc su una riesportazione rispetto a come viene risolto il simbolo originale; il lavoro è completo quando le informazioni al passaggio del mouse mostrano in modo coerente il JSDoc della riesportazione e applicano il relativo comportamento @deprecated al nome riesportato.

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

Valutazione

Stack tecnologico
javascript, typescript, vscode
Ambito
compilers, developer-experience
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.