microsoft / microsoft/TypeScript

Show all JSDoc @typedef properties when forming object of that type

Abierto
#41,171 5 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Experience Enhancement Suggestion
Lenguaje dominante
Go
Estrellas
111k
Forks
14.4k
Merge medio
1 d 19 h
PR fusionados (30 d)
117

Descripción

Issue Type: Feature Request

Problem

When making references to custom types, you cannot really see what that custom type actually is actually composed of.

For example, I have a class called OnlineUser which takes an optional parameter of custom type OnlineUserOptions:

image

When hovering over a reference to the class or forming the object to pass as OnlineUserOptions, only the name of the type is shown in the documentation that is displayed. If you don't know/remember what properties comprise OnlineUserOptions, then the only way to find out is by beginning to type random characters:

image

Suggestion

It would be very useful if instead, as soon as you begin the object literal, it would show all the properties of the custom type, like so:

image

It would also be nice if it was possible to click on the name of the type to jump to its definition (maybe through use of the @link tag?) or hover over it to view its details as though you were hovering over its name in the actual @typedef.

VS Code version: Code 1.50.0 (93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3, 2020-10-07T06:10:52.432Z)
OS version: Windows_NT x64 10.0.19041

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Reproduce el comportamiento en VS Code usando un JSDoc @typedef como OnlineUserOptions y un literal de objeto pasado a ese tipo. Inspecciona el comportamiento de finalización y documentación de TypeScript language-service implicado; se considera terminado cuando aparecen todas las propiedades del typedef al formar el objeto y el tipo puede proporcionar detalles útiles de navegación o al pasar el cursor.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript, typescript
Área
developer-experience, tooling
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.