microsoft / microsoft/TypeScript
Adding documentation comments to the return values of destructuring syntax
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
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:
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 l’esempio di destructuring TypeScript segnalato in VS Code e confronta il suo comportamento al passaggio del mouse con quello dell’esempio useRef documentato. Traccia il comportamento del language service responsabile della documentazione al passaggio del mouse e determina se i tuple bindings possono esporre commenti separati; il lavoro è completato quando appare la documentazione della variabile richiesta senza modificare la struttura originale del codice.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript, vscode
- Ambito
- developer-experience
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 25/100