Typescript - inlay hints for nested labeled tuples
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- typescript
- Ambito
- developer-experience, tooling
Direzione di ricerca
Inizia con l’esempio di tupla etichettata annidata nell’issue e riproducilo in VS Code con tutti i suggerimenti inline abilitati. Confronta la chiamata all’array annidato con la chiamata funzionante di rest-parameter, quindi segui l’entry point dei suggerimenti inline di TypeScript responsabile delle etichette delle tuple. Il lavoro è completato quando le etichette annidate minVals e maxVals compaiono nelle posizioni previste senza introdurre regressioni nell’esempio esistente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Type: Feature Request
The inlay hints for an array of labeled tuples are forgotten.
Troubleshooting steps:
- Ensured Typescript is fully up-to-date.
- Enabled all inlay hints in vsCode settings.
When a type is described as tuple with labels, you can use the ...args: ThatTupleType and when calling the function, the parameters retain the labels. This is working just fine.
However, when the argument is more complex, and there are nested labeled tuples within the type, the inlay hint information is lost (although the type information is still there; TypeScript still knows that the labels are on the array).
The expectation is that if I pass an array of tuples to an argument or type that expects the tuples to adhere to rules, and the type has labels, that the inlay hints should show those nested labels in the appropriate place.
The below example will showcase the issue I'm referring to, when it's run in vsCode with all inlay hints enabled:
type ArmorValueSet = [number, number, number, number, number, number];
type ArmorValueRange = [minVals: ArmorValueSet, maxVals: ArmorValueSet];
const parseArmor = (
armorValues: ArmorValueRange[]
) => {
console.log(armorValues);
};
parseArmor([
[[6, 21, 36, 56, 81, 140], [20, 35, 55, 80, 110, 180]],
[[6, 21, 36, 56, 81, 140], [20, 35, 55, 80, 110, 180]],
[[6, 21, 36, 56, 81, 140], [20, 35, 55, 80, 110, 180]],
[[6, 21, 36, 56, 81, 140], [20, 35, 55, 80, 110, 180]],
[[6, 21, 36, 56, 81, 140], [20, 35, 55, 80, 110, 180]],
]);
const test = (...args: ArmorValueRange) => {
console.log(...args);
}
test([6, 21, 36, 56, 81, 140], [20, 35, 55, 80, 110, 180]);
On line 22, minVals and maxVals are shown correctly. However, from lines 11-15, there are no inlay hints for these tuple labels. The expectation is that each of these lines should look the same as line 22 in terms of the inlay hints that are shown.
Here is a screenshot of what my vsCode editor looks like with this code present:
VS Code version: Code 1.85.1 (0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2, 2023-12-13T09:49:37.021Z)
OS version: Windows_NT x64 10.0.19045
Modes:
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.4k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
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.
Altre issue di microsoft/TypeScript
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
microsoft/TypeScript#64322 · 2 commenti · 1 reazione · 2 assegnatari ·
-
Possible Improvement
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
microsoft/TypeScript#64278 · 1 commento · 1 reazione ·
-
Docs
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
microsoft/TypeScript#64118 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
microsoft/TypeScript#64094 ·
-
Docs
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
microsoft/TypeScript#63959 · 5 commenti ·
Tutte le issue di microsoft/TypeScript
Issue simili
-
optimization optimization:agents-md-curator
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
githubnext/gh-aw-cao#13143 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
blinklabs-io/bursa#904 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
yanet-platform/ipfw-go#129 ·
-
bug confmap/provider/googlesecretmanagerprovider needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
open-telemetry/opentelemetry-collector-contrib#51273 · 2 commenti ·
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100