microsoft / microsoft/TypeScript
Include documentation from a variable's type when you hover the variable
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 117
Beschreibung
Issue Type: Feature request
I had hoped to see the description for the type when hovering over the value via intellisense, etc.
When I hover over context.slot I can see "The slot the disk is in." yet when I try hovering over const slot I see just the type. Is there anything to enable this? Even setting slot to Slot manually it still only shows the type.
/** The slot the disk is in. */
type Slot = string;
interface Context {
/** The slot the disk is in. */
slot?: Slot
}
const func = (context: Context): Context => {
const x = context.slot;
const slot: Slot = context.slot;
return {
slot: x || slot
};
};
func({
slot: '1'
}).slot;
VS Code version: Code 1.43.2 (0ba0ca52957102ca3527cf479571617f0de6ed50, 2020-03-24T07:34:57.037Z)
OS version: Darwin x64 19.2.0
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i5 CPU M 520 @ 2.40GHz (4 x 2400) |
| GPU Status | 2d_canvas: unavailable_software flash_3d: disabled_software flash_stage3d: disabled_software flash_stage3d_baseline: disabled_software gpu_compositing: disabled_software metal: disabled_off multiple_raster_threads: enabled_on oop_rasterization: disabled_off protected_video_decode: disabled_off rasterization: disabled_software skia_renderer: disabled_off_ok video_decode: disabled_software viz_display_compositor: enabled_on viz_hit_test_surface_layer: disabled_off_ok webgl: unavailable_software webgl2: unavailable_software |
| Load (avg) | 1, 1, 2 |
| Memory (System) | 8.00GB (0.79GB free) |
| Process Argv | . |
| Screen Reader | no |
| VM | 0% |
Extensions (27)
| Extension | Author (truncated) | Version |
|---|---|---|
| go-outliner | 766 | 0.1.20 |
| npm-intellisense | chr | 1.3.0 |
| path-intellisense | chr | 1.4.2 |
| jsrefactor | cms | 2.20.5 |
| vue-peek | dar | 1.0.2 |
| vscode-eslint | dba | 2.1.2 |
| EditorConfig | Edi | 0.14.5 |
| vscode-npm-script | eg2 | 0.3.11 |
| flow-for-vscode | flo | 1.5.0 |
| todo-tree | Gru | 0.0.171 |
| docthis | joe | 0.7.1 |
| vscode-home-assistant | kee | 1.6.1 |
| dotenv | mik | 1.0.1 |
| vscode-docker | ms- | 1.0.0 |
| csharp | ms- | 1.21.16 |
| atom-keybindings | ms- | 3.0.6 |
| cpptools | ms- | 0.27.0 |
| Go | ms- | 0.13.1 |
| vscode-typescript-next | ms- | 3.9.20200408 |
| go-doc | msy | 0.1.1 |
| hide-gitignored | npx | 1.1.0 |
| vetur | oct | 0.24.0 |
| vscode-graphql | Pri | 0.2.14 |
| json-template | sto | 0.3.1 |
| vscode-icons | vsc | 10.0.0 |
| vscode-wakatime | Wak | 4.0.0 |
| vscode-go-autotest | win | 1.6.0 |
(2 theme extensions excluded)
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
Beginnen Sie damit, das Hover-Verhalten mit dem TypeScript-Beispiel im Issue zu reproduzieren, und untersuchen Sie den von VS Code verwendeten TypeScript language-service-Hover-Pfad. Ermitteln Sie, wie die Dokumentation für Variablen ausgewählt wird, deren Typen auf Aliase verweisen, und überprüfen Sie anschließend, dass der Hover die Typdokumentation enthält, ohne das bestehende Hover-Verhalten für Properties zu ändern.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- typescript, vscode
- Bereich
- devtools
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100