microsoft / microsoft/TypeScript
prettify complex type display (for generic-heavy types)
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 2g 4h
- PR unite (30g)
- 132
Descrizione
Search Terms
https://github.com/microsoft/TypeScript/labels/Domain%3A%20Type%20Display
Suggestion
give indentations + line-changes on type representation. User config for this might be an option.
Examples
suppose I have some generic-heavy function someFunc that returns
const a = someFunc();
// typeof a = RootGeneric<GenericA, GenericB<number, SubGenericB_A<number> ...
// full type not shown 😭
A better output can be:
// typeof a =
RootGeneric<
GenericA,
GenericB<
number,
SubGenericB_A<number> ...
more things:
- editors can implement "expand(+)" buttons ?
(collapsed-tree-view)
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, etc.)
- This feature would agree with the rest of TypeScript's Design Goals.
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
Non vengono indicati file, test o punti di ingresso. Inizia dagli esempi di tipi fortemente generici dell’issue e determina l’ambito previsto per l’indentazione, le modifiche alle righe, la configurazione dell’utente e l’espansione dell’editor. Il lavoro è completo quando sono stati concordati un design e un piano di implementazione per il comportamento di visualizzazione dei tipi.
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
- Da chiarire
- Idoneità per principianti
- 25/100