microsoft / microsoft/TypeScript
Enums and interfaces do not have definitions in quick info/tooltips
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Go
- Estrellas
- 111k
- Forks
- 14.4k
- Merge medio
- 1 d 19 h
- PR fusionados (30 d)
- 117
Descripción
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)
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Reproduce el comportamiento de quick-info indicado con los ejemplos de enum e interface del issue, tanto localmente como al importarlos. Empieza siguiendo el punto de entrada de quick-info/tooltip de TypeScript y, después, identifica el comportamiento de visualización existente para estas declaraciones. Se considerará completado cuando al pasar el cursor se muestren sus definiciones y miembros, tanto en usos locales como importados, y se hayan actualizado las pruebas relevantes.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- typescript
- Área
- developer-experience, tooling
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100