microsoft / microsoft/TypeScript

@see for property ref in __type__ reference

Aperta
#45,017 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Awaiting More Feedback Domain: JSDoc Experimentation Needed Suggestion
Lingua principale
Go
Stelle
111k
Fork
14.4k
Merge medio
1g 19h
PR unite (30g)
117

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Riproduci l’esempio motivante in VS Code e confronta il modo in cui il riferimento JSDoc @see/@link a A['foo'] viene risolto rispetto al namespace. Inizia validando il comportamento di navigazione segnalato e determinando una sintassi o una regola di risoluzione concreta; il lavoro sarà completato quando sarà stato concordato un approccio per puntare alla proprietà specifica e condividerne la documentazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, typescript
Ambito
compilers, developer-experience
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
15/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.