microsoft / microsoft/TypeScript

@see for property ref in __type__ reference

Offen
#45,017 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Awaiting More Feedback Domain: JSDoc Experimentation Needed Suggestion
Vorherrschende Sprache
Go
Sterne
111k
Forks
14.4k
Ø Merge
1 T. 19 Std.
Gemergte PRs (30 T.)
117

Beschreibung

Suggestion

🔍 Search Terms

jsdoc tsdoc @see @link docs types

✅ Viability Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.

⭐ Suggestion

📃 Motivating Example

export type A = {
  /**
   * The import ID from which the re-export was imported from.
   */
  foo: string
}

export namespace A {
  export type Params = {
    /**
     * @see {@link A['foo']}
     */
    foo: string
  }
  
  export const create = (params:Params): A => {
      return 'todo' as any
  }
}

Here is the above code (approx) in an interactive VSC setting, note the following:

  1. Want to navigate to type alias but it goes to namespace
  2. Want to point at a specific property, cannot

CleanShot 2021-07-13 at 19 44 06

I do not have a concrete suggestion yet about how to achieve this.

First want to validate the problem with others.

💻 Use Cases

Want to share the JSDoc between a property on a constructor and a data type.

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 motivierende Beispiel in VS Code und vergleiche, wie die JSDoc-Referenz @see/@link auf A['foo'] gegenüber dem Namespace aufgelöst wird. Beginne damit, das gemeldete Navigationsverhalten zu validieren und eine konkrete Syntax- oder Auflösungsregel zu bestimmen; abgeschlossen ist die Aufgabe, wenn ein abgestimmter Ansatz dafür vorliegt, auf die spezifische Eigenschaft zu verweisen und ihre Dokumentation zu teilen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, typescript
Bereich
compilers, developer-experience
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
15/100

Neue Issues direkt in Ihr Postfach

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