microsoft / microsoft/TypeScript
Inlay variance hints
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.4k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
🔍 Search Terms
inlay hints, variance annotations
✅ Viability Checklist
- 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 isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
⭐ Suggestion
Display missing variance annotations for type parameters as inlay hints.
Examples:
type Ex1<T> = {}
type Ex2</* out */ T> = () => T
type Ex3</* in */ T> = (in: T) => void
type Ex4</* in out */ T> = (in: T) => T
📃 Motivating Example
It is convenient to know variance of specific type parameters when you're trying to understand how a type works/should be used.
💻 Use Cases
Examining complex 3rd party types.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia esaminando il comportamento richiesto di inlay-hint e i quattro esempi di varianza nell'issue. Determina come devono essere visualizzate le annotazioni mancanti per i parametri di tipo, inclusi i casi in, out e in out. Il lavoro è completato quando gli hint di varianza vengono visualizzati per i tipi applicabili senza modificare il JavaScript emesso o il comportamento esistente di TypeScript/JavaScript.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- compilers
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100