microsoft / microsoft/TypeScript
Enums and interfaces do not have definitions in quick info/tooltips
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 2g 4h
- PR unite (30g)
- 132
Descrizione
The issue might be related to this one, but mine is not about version 3.0, and is not solely about imports.
Search Terms
enum, description, definition, pop-up, tooltip, vs code, interface, suggestion
Suggestion
Hovering over enums and interfaces, should show their definition, i.e. I have this enum (or an interface):
enum enumName {
ONE = 1;
TWO = 2;
THREE = 3;
}
If I hover over this enum, wherever I use it (whether it is imported to another file or used locally where it is declared), I would like to see what this enum is all about (essentially what are the properties).
This is what I see right now when I hover over enums or interfaces:


As a workaround, I currently need to add this type of JSDoc comments right above the enum declaration.
/** Props:
* @param ONE 1;
* @param TWO 2;
* @param THREE 3;
*/
Which yields to:

Use Cases
This feature would save time & effort.
The shortcoming of the current approach is that either need to add ${2+numberOfEnumProperties} lines of comments or go to the file, where enum is declared, locate the enum there and then familiarize myself with its properties.
Examples

Checklist
I am not that experienced to be able to answer the questions below.
- This wouldn't be a breaking change in existing TypeScript / JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. new expression-level syntax)
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
Riproduci il comportamento quick-info segnalato con gli esempi di enum e interface riportati nell’issue, sia localmente sia quando vengono importati. Inizia tracciando l’entry point quick-info/tooltip di TypeScript, quindi individua il comportamento di visualizzazione esistente per queste dichiarazioni. Il lavoro è completo quando, passando il cursore, vengono mostrate le relative definizioni e i membri sia negli usi locali sia in quelli importati, e i test pertinenti sono stati aggiornati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- developer-experience, tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100