microsoft / microsoft/TypeScript

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

Offen
#41,171 5 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Experience Enhancement Suggestion
Vorherrschende Sprache
Go
Sterne
111k
Forks
14.3k
Ø Merge
1 T. 19 Std.
Gemergte PRs (30 T.)
117

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduziere das Verhalten in VS Code mit einem JSDoc @typedef wie OnlineUserOptions und einem Objektliteral, das an diesen Typ übergeben wird. Untersuche das Verhalten von TypeScript language-service bei Vervollständigungen und Dokumentation; als erledigt gilt die Aufgabe, wenn beim Erstellen des Objekts alle typedef-Eigenschaften angezeigt werden und der Typ nützliche Navigations- oder Hover-Details bereitstellen kann.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, typescript
Bereich
developer-experience, tooling
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.