microsoft / microsoft/TypeScript
Adding documentation comments to the return values of destructuring syntax
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
Type: Feature Request
-
In ReactJS, we often write code similar to
const [stateX, setStateX] = useState({ ... });. -
I would like to hover over the variable name
stateXwith the mouse in other places where this variable is used to get an explanation similar to JSDoc (not for type, but to more clearly annotate the purpose of the variable). -
The reason I think this way is because the following approach often works:
/** It's a ref for X */
const refX = useRef({ ... });
(When I hover over the refX variable in other places where it is accessed, the tooltip can display the documentation "It's a ref for X".)
- However, I have not found any way to annotate without disrupting the original code structure, so that VSCode can recognize my documentary comments for the tuple.
- I'm not sure whether this should be considered a feature request or a bug report.
VS Code version: Code 1.95.3 (Universal) (f1a4fb101478ce6ec82fe9627c43efbf9e98c813, 2024-11-13T14:50:04.152Z)
OS version: Darwin arm64 22.3.0
Modes:
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 ejemplo de destructuring de TypeScript reportado en VS Code y compara su comportamiento de hover con el ejemplo documentado de useRef. Rastrea el comportamiento del language service responsable de la documentación del hover y determina si los tuple bindings pueden exponer comentarios separados; se considera terminado cuando aparece la documentación de la variable solicitada sin cambiar la estructura original del código.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- typescript, vscode
- Área
- developer-experience
- 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
- 25/100