microsoft / microsoft/TypeScript
Adding documentation comments to the return values of destructuring syntax
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.4k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 117
Beschreibung
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:
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere das gemeldete TypeScript-Destructuring-Beispiel in VS Code und vergleiche sein Hover-Verhalten mit dem dokumentierten useRef-Beispiel. Verfolge das Verhalten des Language Service, das für die Hover-Dokumentation verantwortlich ist, und ermittle, ob Tuple-Bindings separate Kommentare offenlegen können; abgeschlossen ist die Aufgabe, wenn die Dokumentation der angeforderten Variable erscheint, ohne die ursprüngliche Code-Struktur zu ändern.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- typescript, vscode
- Bereich
- developer-experience
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 25/100