microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
100.78k stars 12.46k forks source link

Inlay parameter hints don't account for trailing required parameters #59979

Open Andarist opened 1 month ago

Andarist commented 1 month ago

🔎 Search Terms

inlay hints parameters rest spread argument

🕗 Version & Regression Information

⏯ Playground Link

N/A

💻 Code

/// <reference path="fourslash.ts" />

//// function test(...rest: [first: number, ...middle: string[], last: string]) {}
//// test(10, 'a', 'b', 'c')

verify.baselineInlayHints(undefined, {
  includeInlayParameterNameHints: "all",
  includeInlayFunctionParameterTypeHints: true,
});

🙁 Actual behavior

function test(...rest: [first: number, ...middle: string[], last: string]) {}
test(/* first: */10, /* ...middle: */'a', /* last: */'b', 'c')

🙂 Expected behavior

function test(...rest: [first: number, ...middle: string[], last: string]) {}
test(/* first: */10, /* ...middle: */'a', 'b', /* last: */'c')

Additional information about the issue

No response

dappduck commented 1 month ago

Hello @Andarist I started looking at this issue