microsoft / microsoft/TypeScript
JSDoc @name tag does not function
Nessuno ha ancora preso questa issue.
- 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:
- Write in a file with
.jsor.tsextension 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({});
- on a new line at the end of the document type
myComponentwith a dot at its end. - While the text-cursor is after the dot, press
Ctrl+Spaceto 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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- 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