microsoft / microsoft/TypeScript

Inlay hints should support spread arguments for tuple types

Aperta
#45,868 1 commento 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Needs Proposal Suggestion
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:

inlay rest

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:

inlay explicit

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

  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

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

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.