microsoft / microsoft/TypeScript

JSDoc @name tag does not function

Aperta
#31,622 2 commenti 10 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Awaiting More Feedback Suggestion
Lingua principale
Go
Stelle
111k
Fork
14.4k
Merge medio
1g 19h
PR unite (30g)
117

Descrizione

  • VSCode Version: 1.33.1
  • OS Version: Windows 7 x86_64 (but I do not think that is relevant)
  • Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

  1. Write in a file with .js or .ts extension the below sample code:
/**
  Construct a new component

  @class Component
  @classdesc A generic component

  @param {Object} options - Options to initialize the component with
  @param {String} options.name - This component's name, sets {@link Component#lastProperty}
  @param {Boolean} options.visible - Whether this component is vislble, sets {@link Component#firstProperty}
*/
function Component(options) {
  /**
    Whether this component is visible or not

    @name Component#firstProperty
    @type Boolean
    @default false
  */
  this.firstProperty = options.visible;

  /**
    This component's name

    @name Component#lastProperty
    @type String
    @default "Component"
    @readonly
  */
  Object.defineProperty(this, 'lastProperty', {
    value: options.name || 'Component',
    writable: false
  });
}

const myComponent = new Component({});
  1. on a new line at the end of the document type myComponent with a dot at its end.
  2. While the text-cursor is after the dot, press Ctrl+Space to open the auto-completion list.

Current Behavior:

When you chose .js as file extension, only firstProperty is in the auto-completion list (with its type comment and so on).

But when you have it in a file with .ts extension, none of firstProperty and lastProperty will be detected, and JSDoc seems useless.

Expected Behavior:

Both firstProperty and lastProperty should be detected and get placed in the auto-completion list, and that no matter which of .js or .ts file extensions we are using.

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

Riproducete l'esempio di Component fornito sia nei file .js che nei file .ts, quindi esaminate il comportamento del completamento dopo myComponent.. Confrontate quali proprietà definite da JSDoc vengono rilevate in ciascun tipo di file; il lavoro è completato quando sia firstProperty sia lastProperty compaiono negli elenchi dei completamenti per entrambe le estensioni.

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

Valutazione

Stack tecnologico
javascript, typescript
Ambito
devtools
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.