microsoft / microsoft/TypeScript
Inlay hints should support spread arguments for tuple types
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.4k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 117
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test is named in the issue. Reproduce the provided Vector3Tuple spread example with TypeScript inlay hints enabled, then compare it with the explicit-argument example; done means the final false argument is labeled enableTransition and the spread arguments receive appropriate hints.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100