Microsoft/TypeScript

Inlay parameter hints don't account for trailing required parameters

Open

#59,979 opened on Sep 16, 2024

View on GitHub
 (1 comment) (1 reaction) (0 assignees)TypeScript (6,726 forks)batch import
7.0 LS MigrationBugDomain: LS: Inlay HintsHelp Wanted

Repository metrics

Stars
 (48,455 stars)
PR merge metrics
 (Avg merge 6d 17h) (9 merged PRs in 30d)

Description

🔎 Search Terms

inlay hints parameters rest spread argument

🕗 Version & Regression Information

  • This is the behavior in every version I tried

⏯ 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

Contributor guide