microsoft / microsoft/TypeScript
Inlay hints should support spread arguments for tuple types
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.4k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
Issue Type: Bug
Inlay hints don't support rest params spread parameters.
For example, I'm using this method which has the following signature:
controls.setPosition(x: number, y: number, z: number, enableTransition: boolean);
And I want to pass in a Vector3Tuple as the position, say [0,0,0]:
type Vector3Tuple = [number, number, number];
const position: Vector3Tuple = [0,0,0];
controls.setPosition(...position, false);
This is what I see for the inlay hints:

In other words, ...position is showing as a single argument when it should be three.
If I expand the arguments, it does correctly show the hints:

I'm not sure what the inlay hints should show for ...position, however, the final parameter of false should correctly show enableTransition.
VS Code version: Code 1.60.0 (e7d7e9a9348e6a8cc8c03f877d39cb72e5dfb1ff, 2021-09-01T10:41:52.311Z)
OS version: Windows_NT x64 10.0.19042
Restricted Mode: No
Remote OS version: Linux x64 5.10.16.3-microsoft-standard-WSL2
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
Nell’issue non vengono indicati file o test. Riproduci l’esempio fornito di spread di Vector3Tuple con i suggerimenti inlay di TypeScript abilitati, quindi confrontalo con l’esempio con argomenti espliciti; è completato quando l’ultimo argomento false è etichettato enableTransition e gli argomenti dello spread ricevono suggerimenti appropriati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript, vscode
- Ambito
- developer-experience, tooling
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 38/100